/* =========================================
   SUPPORT PAGES - Warm Paper Theme
   Matches landing34 ruled-notebook aesthetic
   ========================================= */

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #faf8f2;
    color: #433422;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    min-height: 100vh;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 39px,
        rgba(180, 167, 145, 0.13) 39px,
        rgba(180, 167, 145, 0.13) 40px
    );
    scrollbar-width: none;
}

/* Paper grain overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
    background: repeating-radial-gradient(
        circle at 1px 1px,
        rgba(120, 100, 70, 0.04) 0px,
        transparent 1px
    );
    background-size: 3px 3px;
}

/* Red margin line on desktop */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 80px;
    width: 2px;
    height: 100%;
    background: rgba(220, 80, 80, 0.12);
    z-index: 0;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

/* --- GRID BACKGROUND (hidden in paper theme) --- */
.global-grid-bg {
    display: none;
}

/* --- NAVIGATION --- */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(250, 248, 242, 0.92);
    border-bottom: 1px solid rgba(196, 184, 154, 0.2);
}

.nav-content {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.01em;
    color: #433422;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-cta {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.65);
    color: #5a4632;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid #c4b89a;
    border-radius: 12px;
    box-shadow: 2px 2px 0 rgba(196, 184, 154, 0.25);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.nav-cta:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 1px 1px 0 rgba(196, 184, 154, 0.25);
    transform: translate(1px, 1px);
}

/* --- PAGE LAYOUT --- */
.page-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.support-page-main {
    padding-top: 104px;
    padding-bottom: 80px;
    min-height: 100vh;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

.legal-page-main {
    padding-top: 104px;
    padding-bottom: 80px;
    min-height: 100vh;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

/* --- FADE IN ANIMATION --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.delay-100 {
    animation-delay: 80ms;
}

.delay-200 {
    animation-delay: 160ms;
}

.delay-300 {
    animation-delay: 240ms;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- CARD STYLE --- */
.support-card,
.legal-card {
    background: rgba(255, 255, 255, 0.55);
    border: 1.5px solid #c4b89a;
    border-top: 4px solid #c4b89a;
    border-radius: 12px;
    padding: 36px 40px;
    transition: border-color 0.2s ease;
}

/* --- KICKER LINE --- */
.support-kicker,
.legal-kicker {
    display: inline-block;
    margin: 0 0 10px 0;
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #5a4632;
    font-weight: 700;
}

/* --- HEADINGS --- */
h1 {
    font-family: 'Caveat', cursive;
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0 0 12px 0;
    color: #433422;
}

h2 {
    font-family: 'Caveat', cursive;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 8px 0;
    color: #433422;
}

h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #433422;
}

/* --- BODY COPY --- */
.support-copy {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.65;
    color: #8b7964;
}

.support-copy + .support-copy {
    margin-top: 8px;
}

.support-muted {
    color: #8b7964;
    opacity: 0.65;
    font-size: 0.85rem;
}

/* --- NOTICE BOX --- */
.support-notice {
    margin-top: 20px;
    border-left: 3px solid #c4b89a;
    background: rgba(255, 255, 255, 0.45);
    color: #8b7964;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    font-size: 0.82rem;
    line-height: 1.55;
}

.support-notice::before {
    display: none;
}

/* --- SECTIONS --- */
.support-section {
    margin-top: 28px;
}

/* --- GRID OF LINK CARDS --- */
.support-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.support-link-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1.5px solid #c4b89a;
    border-top: 4px solid #c4b89a;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    outline: none;
}

.support-link-card:hover,
.support-link-card:focus-visible {
    border-color: #a89874;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 2px 3px 0 rgba(196, 184, 154, 0.2);
}

.support-link-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(196, 184, 154, 0.4);
}

.support-link-card h3 {
    margin-bottom: 6px;
}

.support-link-card p {
    margin: 0;
    color: #8b7964;
    font-size: 0.82rem;
    line-height: 1.5;
}

.support-link-card .card-arrow {
    margin-top: auto;
    padding-top: 14px;
    color: #5a4632;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
    opacity: 0.7;
}

.support-link-card:hover .card-arrow {
    opacity: 1;
}

/* --- BOTTOM LINK PILLS --- */
.support-links {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 2px solid #c4b89a;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    color: #5a4632;
    text-decoration: none;
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    font-weight: 700;
    padding: 8px 16px;
    box-shadow: 2px 2px 0 rgba(196, 184, 154, 0.25);
    transition: all 0.2s ease;
}

.pill-link:hover,
.pill-link:focus-visible {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 1px 1px 0 rgba(196, 184, 154, 0.25);
    transform: translate(1px, 1px);
}

/* =============================================
   LEGAL PAGE TWO-COLUMN LAYOUT
   ============================================= */

.legal-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* --- SIDEBAR TOC --- */
.legal-sidebar {
    position: sticky;
    top: 96px;
    width: 200px;
    min-width: 200px;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    overflow-x: visible;
    padding: 16px 12px;
    flex-shrink: 0;
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.55);
    border: 1.5px solid #c4b89a;
    border-top: 4px solid #c4b89a;
    border-radius: 12px;
    scrollbar-width: none;
}

.legal-sidebar::-webkit-scrollbar {
    display: none;
}

.legal-toc {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.legal-toc-title {
    font-family: 'Caveat', cursive;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: #5a4632;
    opacity: 1;
    padding: 0 0 8px 12px;
    margin: 0;
}

.legal-toc a {
    display: block;
    padding: 6px 12px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #8b7964;
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    font-weight: 450;
}

.legal-toc a:hover {
    color: #433422;
    background: rgba(255, 255, 255, 0.5);
}

.legal-toc a.active {
    color: #5a4632;
    border-left-color: #5a4632;
    background: rgba(255, 255, 255, 0.5);
    font-weight: 550;
}

/* Legal card takes remaining space in layout */
.legal-layout .legal-card {
    flex: 1;
    min-width: 0;
}

/* --- LEGAL PAGE ELEMENTS --- */
.legal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    color: #8b7964;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.15s ease;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
}

.legal-back-link:hover,
.legal-back-link:focus-visible {
    color: #5a4632;
}

.legal-meta {
    margin: 0 0 16px 0;
    color: #8b7964;
    font-size: 0.8rem;
    opacity: 0.7;
}

.legal-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.legal-quick-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #c4b89a;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.45);
    color: #8b7964;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 12px;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.legal-quick-links a:hover,
.legal-quick-links a:focus-visible {
    border-color: #5a4632;
    color: #5a4632;
}

.legal-divider {
    border: 0;
    border-top: 1px solid #c4b89a;
    margin: 0 0 24px 0;
}

/* --- LEGAL SECTIONS --- */
.legal-section {
    margin-top: 24px;
    padding-top: 4px;
    scroll-margin-top: 96px;
}

.legal-section h2 {
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    font-weight: 700;
    color: #433422;
    margin-bottom: 10px;
    padding-left: 0;
    border-left: none;
}

.legal-section p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.75;
    color: #8b7964;
}

.legal-section p + p,
.legal-section p + ul,
.legal-section ul + p,
.legal-section ul + ul {
    margin-top: 10px;
}

.legal-section ul {
    margin: 0;
    padding-left: 20px;
    color: #8b7964;
}

.legal-section ol {
    margin: 0;
    padding-left: 20px;
    color: #8b7964;
}

.legal-section li {
    line-height: 1.65;
    font-size: 0.88rem;
    padding: 2px 0;
}

.legal-section li::marker {
    color: #5a4632;
}

/* --- LEGAL TABLES --- */
.legal-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.85rem;
}

.legal-section th,
.legal-section td {
    padding: 10px 14px;
    text-align: left;
    border: 1px solid #c4b89a;
    color: #8b7964;
}

.legal-section th {
    background: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    color: #433422;
    font-family: 'Caveat', cursive;
    font-size: 1rem;
}

.legal-section td {
    background: rgba(255, 255, 255, 0.3);
}

/* --- CONTACT FOOTER --- */
.legal-contact {
    margin-top: 28px;
    border-top: 1px solid #c4b89a;
    padding-top: 16px;
    color: #8b7964;
    font-size: 0.82rem;
    line-height: 1.6;
}

.legal-contact a {
    color: #5a4632;
    font-weight: 500;
    transition: opacity 0.15s;
}

.legal-contact a:hover {
    opacity: 0.8;
}

/* --- FOOTER --- */
.support-footer {
    text-align: center;
    padding: 32px;
    color: #8b7964;
    border-top: 1px solid #c4b89a;
    font-size: 0.8rem;
}

.support-footer p {
    margin: 0;
}

.support-footer a {
    color: #8b7964;
    text-decoration: none;
    transition: color 0.15s ease;
}

.support-footer a:hover {
    color: #5a4632;
}

.footer-links {
    margin-top: 10px;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}

.footer-links a {
    position: relative;
}

/* --- LINK STYLE INSIDE CONTENT --- */
.content-link {
    color: #5a4632;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s ease;
}

.content-link:hover {
    opacity: 0.75;
}

.legal-version-line {
    margin-top: 24px;
    padding: 8px 12px;
    border: 1.5px dashed #c4b89a;
    border-radius: 8px;
    color: #8b7964;
    font-size: 0.75rem;
    line-height: 1.5;
    word-break: break-word;
    opacity: 0.65;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .legal-layout {
        flex-direction: column;
        gap: 0;
    }

    .legal-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        min-width: unset;
        max-height: none;
        overflow: visible;
        padding: 12px 14px;
        margin-bottom: 20px;
        border-bottom: none;
    }

    .legal-toc {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .legal-toc::-webkit-scrollbar {
        display: none;
    }

    .legal-toc-title {
        padding-left: 0;
        padding-bottom: 6px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .legal-toc a {
        border-left: none;
        border-radius: 8px;
        padding: 4px 10px;
        font-size: 0.72rem;
        border: 1.5px solid #c4b89a;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .legal-toc a.active {
        border-color: #5a4632;
        background: rgba(255, 255, 255, 0.5);
    }

    /* Hide margin line on narrow screens */
    body::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-content {
        padding: 0 20px;
    }

    .nav-cta {
        display: none;
    }

    .support-page-main,
    .legal-page-main {
        padding-left: 16px;
        padding-right: 16px;
        padding-top: 88px;
    }

    .support-card,
    .legal-card {
        padding: 24px 20px;
        border-radius: 10px;
    }

    h1 {
        font-size: clamp(1.75rem, 6vw, 2.25rem);
    }

    h2 {
        font-size: 1.25rem;
    }

    .support-grid {
        grid-template-columns: 1fr;
    }

    .legal-section {
        scroll-margin-top: 80px;
    }

    /* Hide margin line on tablet */
    body::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .support-card,
    .legal-card {
        padding: 20px 16px;
        border-radius: 8px;
    }

    .support-links {
        flex-direction: column;
    }

    .pill-link {
        justify-content: center;
        width: 100%;
    }

    .legal-back-link {
        margin-bottom: 12px;
    }
}

/* ====== AUTH WIDGET — Paper Theme Overrides ====== */
:root {
    --accent-color: #5a4632;
    --accent-subtle: rgba(90,70,50,0.08);
    --surface-color: #faf8f2;
    --surface-1: rgba(196,184,154,0.1);
    --text-primary: #433422;
    --text-secondary: #8b7964;
    --text-tertiary: #b0a488;
    --on-accent-color: #faf8f2;
    --grid-color: #c4b89a;
    --shadow-lg: 0 10px 40px rgba(67,52,34,0.15);
}
.aw-modal-overlay {
    background: rgba(67,52,34,0.4) !important;
}
.aw-modal-card {
    background: #faf8f2 !important;
    border: 1.5px solid #c4b89a !important;
    border-radius: 16px !important;
    box-shadow: 4px 6px 0 rgba(196,184,154,0.25), 0 20px 60px rgba(67,52,34,0.15) !important;
}
.aw-modal-close {
    background: rgba(255,255,255,0.6) !important;
    border-color: #c4b89a !important;
    color: #8b7964 !important;
}
.aw-modal-close:hover {
    background: #fff !important;
    border-color: #5a4632 !important;
    color: #5a4632 !important;
}
.aw-auth-header h2 {
    font-family: 'Caveat', cursive !important;
    font-size: 1.5rem !important;
    color: #433422 !important;
}
.aw-auth-tabs {
    border-color: #c4b89a !important;
    border-radius: 10px !important;
}
.aw-auth-tab {
    background: rgba(196,184,154,0.1) !important;
    color: #8b7964 !important;
    font-family: 'Caveat', cursive !important;
    font-size: 1rem !important;
}
.aw-auth-tab.active {
    background: #5a4632 !important;
    color: #faf8f2 !important;
}
.aw-auth-input {
    background: rgba(255,255,255,0.7) !important;
    border: 1.5px solid #c4b89a !important;
    border-radius: 10px !important;
    color: #433422 !important;
}
.aw-auth-input:focus {
    border-color: #5a4632 !important;
    box-shadow: 0 0 0 2px rgba(90,70,50,0.1) !important;
}
.aw-auth-input::placeholder {
    color: #b0a488 !important;
}
.aw-auth-submit {
    background: #5a4632 !important;
    color: #faf8f2 !important;
    border-radius: 12px !important;
    font-family: 'Caveat', cursive !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    box-shadow: 2px 3px 0 rgba(90,70,50,0.2) !important;
}
.aw-auth-submit:hover {
    background: #433422 !important;
}
.aw-auth-google {
    background: rgba(255,255,255,0.7) !important;
    border: 1.5px solid #c4b89a !important;
    border-radius: 12px !important;
    color: #433422 !important;
}
.aw-auth-google:hover {
    border-color: #5a4632 !important;
    background: rgba(255,255,255,0.9) !important;
}
.aw-auth-divider { color: #b0a488 !important; }
.aw-auth-divider::before, .aw-auth-divider::after { background: #c4b89a !important; }
.aw-auth-legal { color: #b0a488 !important; }
.aw-auth-legal a { color: #5a4632 !important; }
.aw-dropdown {
    background: #faf8f2 !important;
    border: 1.5px solid #c4b89a !important;
    border-radius: 12px !important;
    box-shadow: 3px 4px 0 rgba(196,184,154,0.2), 0 10px 30px rgba(67,52,34,0.1) !important;
}
.aw-dropdown-email { color: #8b7964 !important; border-color: rgba(196,184,154,0.3) !important; }
.aw-dropdown-item { color: #433422 !important; border-radius: 8px !important; }
.aw-dropdown-item:hover { background: rgba(196,184,154,0.12) !important; }
.aw-avatar-btn { background: #5a4632 !important; color: #faf8f2 !important; }
.nav-cta {
    font-family: 'Caveat', cursive !important;
    font-size: 1rem !important;
    background: #5a4632 !important;
    color: #faf8f2 !important;
    border-radius: 12px !important;
    padding: 6px 18px !important;
    border: none !important;
    box-shadow: 2px 3px 0 rgba(90,70,50,0.2) !important;
}
.nav-cta:hover { background: #433422 !important; }
.aw-signin-btn {
    font-family: 'Caveat', cursive !important;
    font-size: 1rem !important;
    background: rgba(255,255,255,0.65) !important;
    color: #5a4632 !important;
    border: 2px solid #c4b89a !important;
    border-radius: 12px !important;
    padding: 5px 16px !important;
    box-shadow: 1px 2px 0 rgba(196,184,154,0.2) !important;
}
.aw-signin-btn:hover {
    background: rgba(255,255,255,0.95) !important;
    border-color: #5a4632 !important;
}
