/**
 * ====================================================================
 * MAIN.CSS - GIAO DIỆN CAO CẤP CHUẨN TMAILOR & TEMP-MAIL (2026 EDITION)
 * Tông màu: Dark Navy (#0c1e36), Deep Red (#be123c), Vibrant Blue (#2563eb)
 * ====================================================================
 */

:root {
    --navy-header: #0b1a30;
    --navy-card: #081426;
    --red-primary: #be123c;
    --red-hover: #9f1239;
    --blue-accent: #2563eb;
    --blue-light: #3b82f6;
    
    --bg-page: #f8fafc;
    --card-white: #ffffff;
    --border-light: #e2e8f0;
    --border-dark: #cbd5e1;

    --text-navy: #0f172a;
    --text-white: #ffffff;
    --text-muted: #64748b;
    --text-sub: #94a3b8;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;

    --content-max-width: 820px; /* Cân đối rộng rãi cho hòm thư */
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.04);
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-navy);
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ================= 1. NAVBAR (STICKY DARK NAVY) ================= */
.navbar-dark {
    background-color: var(--navy-header);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-white);
}

.logo-box {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.nav-item:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.14);
    font-weight: 600;
}

.btn-signin-red {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: var(--red-primary);
    color: #ffffff;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(190, 18, 60, 0.3);
}

.btn-signin-red:hover {
    background-color: var(--red-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(190, 18, 60, 0.4);
}

/* ================= FLASH BANNER ================= */
.flash-banner {
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
}
.flash-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--content-max-width);
    margin: 0 auto;
}
.flash-banner button {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error   { background: #fee2e2; color: #991b1b; }

/* ================= 2. HERO DARK NAVY SECTION ================= */
.hero-navy-section {
    background: radial-gradient(circle at 50% 20%, #132a4e 0%, #0b1a30 100%);
    padding: 44px 0 48px 0;
    text-align: center;
    position: relative;
}

.hero-top-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #93c5fd;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.badge-sparkle {
    font-size: 14px;
}

.hero-headline {
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero-description {
    color: #94a3b8;
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 620px;
    margin: 0 auto 30px auto;
}

/* WHITE HERO CARD (CÂN ĐỐI 820PX) */
.tempmail-card {
    background: var(--card-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.35);
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 24px 28px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-caption {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.card-expiry-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #e11d48;
    background: #fff1f2;
    border: 1px solid #ffe4e6;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.card-expiry-badge strong {
    font-family: monospace;
    font-size: 13.5px;
    color: #be123c;
}

/* KHỐI INPUT + COPY + ACCESS DETAILS RÕ RÀNG */
.email-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.email-field-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: #f8fafc;
    padding: 0 14px;
    height: 48px;
    transition: all 0.2s ease;
}

.email-field-wrapper:focus-within {
    border-color: var(--blue-accent);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.envelope-icon {
    color: #64748b;
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.email-text-box {
    width: 100%;
    border: none;
    outline: none;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-navy);
    font-family: 'Inter', monospace;
    background: transparent;
}

.email-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-copy-outline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 48px;
    padding: 0 18px;
    background: var(--blue-accent);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-copy-outline:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.btn-qr-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0 14px;
    background: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.btn-qr-outline:hover {
    background: #f8fafc;
    border-color: var(--border-dark);
}

.btn-access-dark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0 16px;
    background: var(--navy-header);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.btn-access-dark:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

/* THẺ TÍNH NĂNG NHỎ TRONG HERO CARD */
.card-features-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

/* ================= 3. ACTION PILLS ROW ================= */
.action-bar-section {
    padding: 24px 0 18px 0;
    background: transparent;
}

.action-pills-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: var(--content-max-width);
    margin: 0 auto;
    flex-wrap: wrap;
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
    text-decoration: none;
}

.pill-btn-red {
    background: var(--red-primary);
    color: #ffffff;
}

.pill-btn-red:hover {
    background: var(--red-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(190, 18, 60, 0.35);
}

.pill-btn-white {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid var(--border-light);
}

.pill-btn-white:hover {
    background: #f8fafc;
    border-color: var(--border-dark);
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.pill-btn-danger:hover {
    color: var(--red-primary);
    border-color: #fca5a5;
    background: #fff1f2;
}

/* ================= 4. INBOX SECTION (ĐỒNG BỘ 820PX) ================= */
.inbox-section {
    padding-bottom: 60px;
}

.inbox-box-card {
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    max-width: var(--content-max-width);
    margin: 0 auto;
    overflow: hidden;
}

.inbox-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    gap: 16px;
}

.inbox-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inbox-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inbox-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-navy);
}

.inbox-badge-pill {
    background: var(--red-primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    min-width: 22px;
    text-align: center;
}

.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.pulsing-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.inbox-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    padding: 6px 12px;
    flex: 1;
    max-width: 280px;
    transition: all 0.2s;
}

.inbox-search-box:focus-within {
    border-color: var(--blue-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.inbox-search-box input {
    border: none;
    background: transparent;
    font-size: 13px;
    outline: none;
    width: 100%;
    color: var(--text-navy);
}

.inbox-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sound-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid var(--border-light);
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sound-toggle.active {
    color: var(--blue-accent);
    background: #eff6ff;
    border-color: #bfdbfe;
}

.btn-sound-toggle:hover {
    transform: scale(1.05);
}

.btn-inbox-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border-light);
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-inbox-refresh:hover {
    background: #f8fafc;
    border-color: var(--border-dark);
}

.spin-active {
    animation: spin 0.8s linear infinite;
}

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

/* EMPTY STATE */
.empty-inbox-state {
    text-align: center;
    padding: 60px 24px;
}

.mailbox-illustration {
    margin-bottom: 16px;
}

.icon-bubble {
    width: 76px;
    height: 76px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-navy);
    margin-bottom: 6px;
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 440px;
    margin: 0 auto 16px auto;
    line-height: 1.6;
}

.empty-tips {
    display: inline-block;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1e40af;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
}

/* ACTIVE MAIL LIST & ROWS */
.messages-list-table {
    display: flex;
    flex-direction: column;
}

.mail-row {
    display: grid;
    grid-template-columns: 44px 180px 1fr 120px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13.5px;
}

.mail-row:hover {
    background: #f8fafc;
}

.mail-row.mail-unread {
    background: #f0f7ff;
    font-weight: 600;
}

.mail-row.mail-unread:hover {
    background: #e0f0fe;
}

.mail-avatar-col {
    display: flex;
    align-items: center;
}

.sender-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13.5px;
    color: #ffffff;
    background: #64748b;
    text-transform: uppercase;
}

/* SENDER AVATAR DYNAMIC COLOR PALETTES */
.avatar-a, .avatar-b { background: #ef4444; }
.avatar-c, .avatar-d { background: #f97316; }
.avatar-e, .avatar-f { background: #eab308; }
.avatar-g, .avatar-h { background: #10b981; }
.avatar-i, .avatar-j { background: #06b6d4; }
.avatar-k, .avatar-l { background: #3b82f6; }
.avatar-m, .avatar-n { background: #6366f1; }
.avatar-o, .avatar-p { background: #8b5cf6; }
.avatar-q, .avatar-r { background: #d946ef; }
.avatar-s, .avatar-t { background: #ec4899; }
.avatar-u, .avatar-v { background: #14b8a6; }
.avatar-w, .avatar-x { background: #f43f5e; }
.avatar-y, .avatar-z { background: #84cc16; }

.mail-sender-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.sender-name {
    font-weight: 600;
    color: var(--text-navy);
}

.mail-subject-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 14px;
}

.subject-text {
    color: #1e293b;
    font-weight: 600;
}

.snippet-text {
    color: #64748b;
    font-weight: 400;
    margin-left: 6px;
}

.mail-time-col {
    text-align: right;
    white-space: nowrap;
}

.time-badge {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* ================= 5. FEATURES SECTION ================= */
.features-section {
    padding: 70px 0;
    background: #ffffff;
    border-top: 1px solid var(--border-light);
}

.section-heading {
    text-align: center;
    margin-bottom: 44px;
}

.sub-heading {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--red-primary);
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.main-heading {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-navy);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.heading-desc {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.features-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    background: #f8fafc;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px 22px;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.icon-shield { background: #dcfce7; color: #16a34a; }
.icon-zap    { background: #fef3c7; color: #d97706; }
.icon-lock   { background: #e0e7ff; color: #4f46e5; }
.icon-code   { background: #e0f2fe; color: #0284c7; }

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-navy);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ================= 6. HOW IT WORKS 3-STEP SECTION ================= */
.how-it-works-section {
    padding: 70px 0;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
}

.steps-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.step-card {
    background: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    position: relative;
    transition: all 0.2s ease;
}

.step-card:hover {
    border-color: var(--blue-accent);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.step-num {
    font-size: 38px;
    font-weight: 800;
    color: #cbd5e1;
    margin-bottom: 16px;
    line-height: 1;
    font-family: monospace;
}

.step-card:hover .step-num {
    color: var(--blue-accent);
}

.step-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-navy);
    margin-bottom: 10px;
}

.step-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ================= 7. FAQ ACCORDION SECTION ================= */
.faq-section {
    padding: 70px 0;
    background: #ffffff;
    border-top: 1px solid var(--border-light);
}

.faq-accordion {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: #f8fafc;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.faq-item:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.faq-item.active {
    border-color: var(--blue-accent);
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-navy);
    user-select: none;
}

.faq-chevron {
    font-size: 16px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}

.faq-item.active .faq-chevron {
    transform: rotate(180deg);
    color: var(--blue-accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 22px;
    background: #ffffff;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 22px 20px 22px;
}

.faq-answer p {
    font-size: 14px;
    color: #475569;
    line-height: 1.65;
    margin: 0;
}

/* ================= 8. MODALS & POPUPS ================= */
.tmailor-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 26, 48, 0.65);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}

.tmailor-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tmailor-modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.2s ease;
}

.tmailor-modal-overlay.active .tmailor-modal-card {
    transform: scale(1);
}

.modal-large {
    max-width: 820px;
}

.modal-sm {
    max-width: 380px;
}

.modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-icon-badge {
    font-size: 18px;
}

.modal-top h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-navy);
}

.btn-close-x {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.btn-close-x:hover {
    color: var(--text-navy);
}

.modal-body-content {
    padding: 22px;
    max-height: 72vh;
    overflow-y: auto;
}

.modal-intro {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.cred-info-group {
    margin-bottom: 14px;
}

.cred-info-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cred-copy-box {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f8fafc;
}

.cred-copy-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: monospace;
    color: var(--text-navy);
    outline: none;
}

.cred-copy-box button {
    background: #ffffff;
    border: none;
    border-left: 1px solid var(--border-light);
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--blue-accent);
    cursor: pointer;
}

.cred-copy-box button:hover {
    background: #eff6ff;
}

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-navy);
    margin-bottom: 6px;
}

.form-text-input, .form-select-input {
    width: 100%;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-text-input:focus, .form-select-input:focus {
    border-color: var(--blue-accent);
}

.modal-bottom {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    background: #fafafa;
}

.btn-modal-primary {
    background: var(--navy-header);
    color: #ffffff;
    border: none;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-modal-primary:hover {
    background: #1e293b;
}

.btn-modal-ghost {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    cursor: pointer;
}

.btn-modal-ghost:hover {
    background: #f1f5f9;
}

.btn-modal-danger {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-right: auto;
}

.btn-modal-danger:hover {
    background: #dc2626;
}

/* ================= 9. EMAIL DETAIL VIEWER ================= */
.viewer-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.viewer-subject-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-unread-pill {
    background: var(--blue-accent);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.mail-detail-meta-bar {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 22px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #475569;
}

.meta-field strong {
    color: var(--text-navy);
}

.mail-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 22px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: #ffffff;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.tool-btn.active {
    background: var(--navy-header);
    color: #ffffff;
    border-color: var(--navy-header);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-action-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: #ffffff;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.tool-action-btn:hover {
    background: #f1f5f9;
}

.mail-scrollable-body {
    padding: 22px;
    min-height: 240px;
}

.mail-body-rendered {
    font-size: 14.5px;
    line-height: 1.65;
    color: #1e293b;
    word-break: break-word;
}

.mail-body-plain {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
    font-size: 13.5px;
    color: #334155;
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

/* ================= 10. HISTORY MODAL ITEMS ================= */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    transition: all 0.15s;
}

.history-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.history-item-current {
    border-color: #93c5fd;
    background: #eff6ff;
}

.history-email-text {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-navy);
    font-family: 'Inter', monospace;
}

.history-active-tag {
    font-size: 11px;
    background: #2563eb;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 4px;
    margin-left: 6px;
    font-family: sans-serif;
    font-weight: 600;
}

.history-time-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.btn-history-switch {
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--blue-accent);
    color: #ffffff;
    border: none;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-history-switch:hover {
    background: #1d4ed8;
}

/* ================= 11. API DOCS MODAL STYLES ================= */
.api-doc-box {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 10px;
}

.api-doc-box code {
    font-family: monospace;
    font-size: 13px;
    color: var(--blue-accent);
    word-break: break-all;
}

.badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
}
.badge-post { background: #dcfce7; color: #166534; }
.badge-get  { background: #dbeafe; color: #1e40af; }

.doc-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ================= 12. FOOTER ================= */
.footer-tmailor {
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    padding: 32px 0 20px 0;
    margin-top: auto;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.footer-brand {
    font-size: 16px;
    color: var(--text-navy);
    margin-bottom: 4px;
}

.footer-desc {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 460px;
}

.footer-col-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.footer-col-right a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col-right a:hover {
    color: var(--text-navy);
}

.footer-bottom-copy {
    text-align: center;
    font-size: 12px;
    color: var(--text-sub);
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}
