/* ═══════════════════════════════════════════════════
   fckemail — Light theme, temp-mail style
   ═══════════════════════════════════════════════════ */

:root {
    --bg: #f5f7fa;
    --white: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f0f2f5;
    --border: #e2e5ea;
    --border-light: #eef0f3;
    --text: #1a1d23;
    --text-secondary: #4a5568;
    --text-muted: #8892a4;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-bg: rgba(79, 70, 229, 0.08);
    --green: #10b981;
    --green-bg: #ecfdf5;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --orange: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ─── */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    font-weight: 700;
}

.logo span { color: var(--primary); }

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-nav a, .header-nav button {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}

.header-nav a:hover, .header-nav button:hover {
    background: var(--surface-alt);
    color: var(--text);
    text-decoration: none;
}

.lang-toggle {
    font-weight: 600;
    font-size: 0.8rem !important;
    border: 1px solid var(--border) !important;
    padding: 0.35rem 0.65rem !important;
    border-radius: 6px !important;
    color: var(--text-muted) !important;
}

.lang-toggle:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: var(--primary-light) !important;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-family: var(--font);
    line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-alt);
    border-color: #ccc;
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--surface-alt);
    color: var(--text);
    border-color: #ccc;
}

.btn-icon.copied {
    background: var(--green-bg);
    border-color: var(--green);
    color: var(--green);
}

.btn-large {
    padding: 0.85rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

/* ─── Hero / Email Generator ─── */
.hero {
    background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%);
    padding: 3rem 1.5rem 2rem;
    text-align: center;
}

.hero-inner {
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Email display box ─── */
.email-box {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    min-height: 180px;
}

.email-box-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.email-box-address-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.email-box-address {
    flex: 1;
    font-family: var(--mono);
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(79, 70, 229, 0.15);
    text-align: center;
    user-select: all;
    word-break: break-all;
    min-width: 0;
}

.email-box-actions {
    display: flex;
    gap: 0.5rem;
}

.email-box-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.email-box-timer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.email-box-timer .timer-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* ─── Duration pills ─── */
.duration-bar {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.dur-pill {
    padding: 0.35rem 0.9rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
}

.dur-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.dur-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.email-box-loading {
    text-align: center;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Before email generated: show loading, hide address/meta */
.email-box--empty .email-box-address-row,
.email-box--empty .email-box-meta,
.email-box--empty .email-box-label { display: none; }

.email-box--ready .email-box-loading { display: none; }

/* ─── Inbox section ─── */
.inbox-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

.inbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.inbox-toolbar h2 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inbox-toolbar .msg-count {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
}

.inbox-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auto-refresh-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── Inbox table ─── */
.inbox-table {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.inbox-row {
    display: grid;
    grid-template-columns: 200px 1fr 120px;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.1s;
    align-items: center;
    font-size: 0.9rem;
}

.inbox-row:last-child { border-bottom: none; }

.inbox-row:hover {
    background: var(--primary-light);
}

.inbox-row-head {
    background: var(--surface-alt);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: default;
    padding: 0.65rem 1.25rem;
}

.inbox-row-head:hover { background: var(--surface-alt); }

.inbox-from {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 1rem;
}

.inbox-subject {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 1rem;
}

.inbox-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: right;
}

.inbox-empty {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--text-muted);
}

.inbox-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.inbox-empty p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.inbox-empty .spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}

/* ─── Message detail ─── */
.message-detail {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: none;
    box-shadow: var(--shadow-sm);
}

.message-detail.visible { display: block; }

.detail-toolbar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}

.detail-toolbar .btn { font-size: 0.85rem; padding: 0.4rem 0.85rem; }

.detail-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.detail-subject {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.detail-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-body {
    padding: 1.5rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.detail-body iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    border-radius: var(--radius-sm);
}

.detail-attachments {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Features section ─── */
.features {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.features h2 {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.features .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #d0d5dd;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.feature-icon.blue { background: var(--primary-light); }
.feature-icon.green { background: var(--green-bg); }
.feature-icon.orange { background: #fff7ed; }

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── How it works ─── */
.how-it-works {
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 4rem 1.5rem;
}

.how-it-works-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.how-it-works h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    letter-spacing: -0.3px;
}

.steps {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.step {
    flex: 1;
    max-width: 220px;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.step p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ─── FAQ ─── */
.faq-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.faq-section h2 {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.3px;
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.faq-item summary {
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.1s;
}

.faq-item summary:hover { background: var(--surface-alt); }

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 400;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item[open] summary { border-bottom: 1px solid var(--border-light); }
.faq-item[open] summary::after { content: '\2212'; }

.faq-item .faq-answer {
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ─── Auth modal ─── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.visible { display: flex; }

.modal {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s ease;
}

.modal h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.modal .btn { width: 100%; margin-top: 0.5rem; }

.modal .switch-mode {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal .switch-mode a {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

.error-msg {
    color: var(--red);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.5rem;
    display: none;
    background: var(--red-bg);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.error-msg.visible { display: block; }

/* ─── Footer ─── */
footer {
    border-top: 1px solid var(--border);
    background: var(--white);
    padding: 2rem 1.5rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ─── Utility ─── */
.hidden { display: none !important; }

/* ─── Animations ─── */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .features-grid { grid-template-columns: 1fr; }
    .steps { flex-direction: column; align-items: center; }
    .hero h1 { font-size: 1.7rem; }
    .email-box-address { font-size: 1rem; }
    .inbox-row { grid-template-columns: 1fr 100px; }
    .inbox-subject { display: none; }
    .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 480px) {
    .email-box-address-row { flex-direction: column; }
    .email-box-actions { width: 100%; justify-content: center; }
    .header-inner { padding: 0 0.75rem; }
    .header-nav { gap: 0; }
    .header-nav a, .header-nav button { padding: 0.4rem 0.5rem; font-size: 0.8rem; }
    .lang-toggle { padding: 0.25rem 0.5rem !important; font-size: 0.7rem !important; }
    .logo { font-size: 1.2rem; gap: 0.35rem; }
    .logo .logo-icon { width: 26px; height: 26px; font-size: 0.85rem; }
    .hero { padding: 2rem 1rem 1.5rem; }
}
