/* --- EA TOOLKIT: GLOBAL WRAPPER & TYPOGRAPHY --- */
.ea-tool-wrapper, .ea-dashboard-wrapper {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    font-family: 'Lato', 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    box-sizing: border-box;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.ea-tool-wrapper *, .ea-dashboard-wrapper * {
    box-sizing: border-box;
}

.ea-tool-wrapper .ea-step { display: none !important; }
.ea-tool-wrapper .ea-step.active { display: block !important; animation: eaFadeIn 0.4s ease; }

@keyframes eaFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- HEADINGS --- */
.ea-tool-wrapper h2, .ea-dashboard-wrapper h2 {
    font-size: 1.5em;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 700;
}

/* --- FORM ELEMENTS --- */
.ea-form-group {
    margin-bottom: 25px;
    position: relative;
}

.ea-form-group label {
    display: block;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #333;
    font-weight: 500;
    font-size: 16px;
}

.ea-desc {
    color: #000;
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 1.6;
}

.ea-tool-wrapper input[type="email"],
.ea-tool-wrapper input[type="text"],
.ea-tool-wrapper select,
.ea-tool-wrapper textarea,
.ea-dashboard-wrapper input[type="email"],
.ea-dashboard-wrapper input[type="text"],
.ea-dashboard-wrapper select,
.ea-dashboard-wrapper textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: #fafafa;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    color: #333;
}

.ea-tool-wrapper select,
.ea-dashboard-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 40px;
    height: auto;
    min-height: 50px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ea-tool-wrapper textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.ea-tool-wrapper input:focus,
.ea-tool-wrapper select:focus,
.ea-tool-wrapper textarea:focus,
.ea-dashboard-wrapper input:focus,
.ea-dashboard-wrapper select:focus {
    outline: none;
    border-color: #1e8449;
    background: #fff;
}

.ea-input-disabled {
    background-color: #eee !important;
    color: #888;
    cursor: not-allowed;
}

/* --- VALIDATION & MESSAGES --- */
.ea-error-border {
    border-color: #c0392b !important;
    background-color: #fdf2f2 !important;
}

.ea-error-msg {
    color: #c0392b;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
    font-weight: 600;
}

.ea-otp-success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 16px;
    border: 1px solid #c3e6cb;
    text-align: center;
}

/* --- PROGRESS BAR --- */
.ea-progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-bottom: 30px;
    overflow: hidden;
    max-width: 100%;
}

.ea-progress-fill {
    height: 100%;
    background: #1e8449;
    border-radius: 3px;
    transition: width 0.3s ease;
    max-width: 100%;
}

/* --- TONE SELECTION CARDS --- */
.ea-tone-cards {
    margin-bottom: 15px;
}

.ea-tone-card {
    display: block;
    padding: 0;
    border: 2px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.ea-tone-card:hover {
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ea-tone-card input[type="radio"] {
    display: none;
}

.ea-tone-card input[type="radio"]:checked + .ea-tone-inner {
    background: #f0faf4;
    border-left: 4px solid #1e8449;
}

.ea-tone-inner {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    gap: 4px;
    transition: background 0.2s;
}

.ea-tone-inner strong {
    font-size: 16px;
    color: #1a1a1a;
}

.ea-tone-detail {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* --- BUTTONS --- */
.ea-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    gap: 10px;
}

button.ea-btn-next, button.ea-btn-submit, #ea-btn-verify, #ea-btn-dash-login {
    background: #000;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 18px;
    transition: background 0.2s, transform 0.1s;
}

button.ea-btn-next:hover, button.ea-btn-submit:hover, #ea-btn-verify:hover, #ea-btn-dash-login:hover {
    background: #222;
    color: #fff;
}

button.ea-btn-prev {
    background: #f3f4f6;
    color: #333;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 18px;
    font-weight: 500;
}

button.ea-btn-prev:hover {
    background: #e5e7eb;
}

button.ea-btn-skip {
    background: transparent;
    color: #888;
    border: 1px solid #ddd;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 18px;
    transition: all 0.2s;
}

button.ea-btn-skip:hover {
    color: #555;
    border-color: #bbb;
}

button:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- LOGIN LINK --- */
.ea-login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.ea-login-link a {
    color: #1e8449;
    text-decoration: none;
    font-weight: 500;
}

.ea-login-link a:hover {
    text-decoration: underline;
}

/* --- PDF DOWNLOAD BUTTON --- */
.ea-download-pdf-btn {
    background: #000;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.ea-download-pdf-btn:hover {
    background: #222;
    color: white !important;
    transform: translateY(-1px);
}

.ea-download-pdf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- PAYWALL BUTTON --- */
.ea-btn-unlock {
    display: inline-block;
    background: #000;
    color: #fff !important;
    font-size: 18px;
    font-weight: bold;
    padding: 16px 36px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
}

.ea-btn-unlock:hover {
    transform: translateY(-2px);
    color: #fff;
    background: #222;
}

/* --- RESULT BOX --- */
.ea-result-box {
    animation: eaFadeIn 0.4s ease;
}

/* --- GENERATING ANIMATION --- */
.ea-generating-overlay {
    text-align: center;
    padding: 60px 20px;
}

.ea-generating-overlay h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.ea-generating-overlay p {
    color: #888;
    font-size: 16px;
}

.ea-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #1e8449;
    border-radius: 50%;
    animation: eaSpin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes eaSpin {
    to { transform: rotate(360deg); }
}

/* --- DASHBOARD STYLES --- */
.ea-dashboard-login {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.ea-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.ea-user-info {
    font-size: 0.95em;
    color: #555;
}

#ea-btn-logout {
    margin-left: 15px;
    color: #c0392b;
    text-decoration: none;
    font-weight: 600;
}

.ea-empty-state {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #777;
    font-size: 16px;
}

.ea-empty-state a {
    color: #1e8449;
    font-weight: 600;
}

.ea-entry-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.ea-entry-card:hover { transform: translateY(-1px); }

.ea-entry-card.paid { border-left: 5px solid #1e8449; }
.ea-entry-card.unpaid { border-left: 5px solid #e9c46a; }

.ea-card-main h3 { margin: 0 0 5px 0; font-size: 1.1em; color: #333; }
.ea-meta { font-size: 0.85em; color: #888; display: block; }

.ea-status-badge {
    display: inline-block;
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 5px;
}
.ea-status-badge.paid { background: #e0fbf6; color: #1e8449; }
.ea-status-badge.free { background: #d4edda; color: #155724; }
.ea-status-badge.unpaid { background: #fff8e1; color: #d4a017; }

.ea-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ea-card-actions button {
    font-size: 0.85em;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
    font-weight: 500;
}

.ea-btn-view-eulogy { background: #1e8449; color: white; }
.ea-btn-view-eulogy:hover { opacity: 0.9; }

.ea-btn-preview-eulogy { background: #f3f4f6; color: #333; border: 1px solid #ddd !important; }
.ea-btn-preview-eulogy:hover { background: #e5e7eb; }

.ea-btn-delete { 
    background: white; 
    color: #c0392b; 
    border: 1px solid #c0392b !important; 
    font-size: 1.2em !important; 
    padding: 4px 10px !important; 
    line-height: 1; 
}
.ea-btn-delete:hover { background: #c0392b; color: white; }

/* --- MODAL --- */
.ea-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

.ea-modal-content {
    position: fixed;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ea-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #f3f4f6;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #555;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ea-modal-close:hover {
    background: #e5e7eb;
}

/* --- FULL EULOGY VIEW --- */
.ea-full-eulogy-view {
    animation: eaFadeIn 0.4s ease;
}

/* --- Mobile Adjustments --- */
@media (max-width: 600px) {
    .ea-tool-wrapper, .ea-dashboard-wrapper { padding: 20px; }
    .ea-entry-card { flex-direction: column; align-items: flex-start; }
    .ea-card-actions { margin-top: 15px; width: 100%; display: flex; justify-content: space-between; }
    .ea-card-actions button { margin-left: 0; }
    .ea-dashboard-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    #ea-btn-logout { margin-left: 0; }
    .ea-nav-buttons { flex-wrap: wrap; }
    .ea-tone-inner { padding: 14px 16px; }
    .ea-modal-content { width: 95%; padding: 20px; top: 2%; }
}

@media print {
    .ea-download-pdf-btn, .ea-modal-close, .ea-card-actions, .ea-dashboard-header, .ea-nav-buttons {
        display: none !important;
    }
    .ea-modal-content {
        position: static;
        transform: none;
        width: 100%;
        max-height: none;
        box-shadow: none;
        padding: 0;
    }
    .ea-modal-overlay {
        display: none;
    }
}
