/* ================================================================
   auth.css — Shared styles for Sappar Studio auth pages
   (signup, login, dashboard)
   ================================================================ */

/* ── Reset ── */

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

/* ── Custom properties ── */

:root {
    --bg: #1A1A1A;
    --bg-deep: #141414;
    --surface: #242424;
    --surface-raised: #2E2E2E;
    --text: #F0EDE8;
    --text-secondary: #9A9590;
    --text-tertiary: #5E5A55;
    --border: #333330;
    --border-subtle: rgba(200, 168, 130, 0.08);
    --accent: #C8A882;
    --accent-hover: #D4B896;
    --accent-muted: rgba(200, 168, 130, 0.12);
    --accent-glow: rgba(200, 168, 130, 0.06);
    --font-display: 'Cormorant Garamond', 'Garamond', 'Georgia', serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-ui: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --max-width: 1100px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── Base elements ── */

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ── Grain texture overlay ── */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 512px 512px;
}

/* ── Utility ── */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Navigation ── */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.4s var(--ease-out-quart);
}

nav.scrolled {
    padding: 14px 0;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border-subtle);
}

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

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

.nav-brand img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.nav-brand span {
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: 18px;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

.nav-brand .brand-sappar {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 22px;
    color: var(--text);
    letter-spacing: 0.01em;
}

.nav-cta {
    font-family: var(--font-ui) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--accent) !important;
    background: transparent !important;
    border: 1.5px solid rgba(200, 168, 130, 0.35) !important;
    padding: 9px 22px !important;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease !important;
    letter-spacing: 0.04em !important;
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    background: rgba(200, 168, 130, 0.06) !important;
    color: var(--accent-hover) !important;
    border-color: rgba(200, 168, 130, 0.7) !important;
    box-shadow: 0 0 20px rgba(200, 168, 130, 0.1);
}

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

/* ── Primary button ── */

.btn-primary {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    color: var(--accent);
    background: rgba(200, 168, 130, 0.03);
    padding: 16px 40px;
    border-radius: 8px;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: all 0.4s var(--ease-out-quart);
    border: 1.5px solid rgba(200, 168, 130, 0.35);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(200, 168, 130, 0.06) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-primary:hover {
    border-color: rgba(200, 168, 130, 0.7);
    color: var(--accent-hover);
    background: rgba(200, 168, 130, 0.06);
    transform: translateY(-2px);
    box-shadow:
        0 0 20px rgba(200, 168, 130, 0.1),
        0 0 40px rgba(200, 168, 130, 0.04);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(200, 168, 130, 0.08);
}

/* ── Footer ── */

footer {
    padding: 56px 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-left {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.footer-links a {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

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

.footer-built {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--text-tertiary);
    font-style: italic;
    letter-spacing: 0.01em;
}


/* ================================================================
   Auth-specific styles
   ================================================================ */

/* ── Auth page layout ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 0 80px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 56px 48px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.24),
        0 8px 20px rgba(0, 0, 0, 0.14),
        0 24px 48px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Warm glow behind auth card */
.auth-card::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(200, 168, 130, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.auth-card h1 {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: 8px;
    text-align: center;
    position: relative;
}

.auth-card .auth-subtitle {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    margin-bottom: 40px;
    position: relative;
}

/* ── Form fields ── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-input {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 400;
    color: var(--text);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-top-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 14px 18px;
    outline: none;
    letter-spacing: 0.01em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px var(--accent-muted);
}

.auth-form .btn-primary {
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

.auth-error {
    font-family: var(--font-ui);
    font-size: 14px;
    color: #E87C6F;
    text-align: center;
    min-height: 20px;
    margin-top: 4px;
}

.auth-footer-text {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 28px;
    position: relative;
}

.auth-footer-text a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer-text a:hover {
    color: var(--accent-hover);
}

/* ── Dashboard layout ── */
.dashboard-main {
    flex: 1;
    padding: 120px 0 80px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 720px;
    margin: 0 auto;
}

.dashboard-grid--with-sidebar {
    max-width: 1060px;
    grid-template-columns: 1fr 300px;
}

.dashboard-grid--with-sidebar .early-supporter-card {
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.24),
        0 4px 12px rgba(0, 0, 0, 0.14),
        0 12px 28px rgba(0, 0, 0, 0.08);
}

.dash-card h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    line-height: 1.2;
}

.dash-card p {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Status badge */
.status-badge {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.status-badge.pending {
    color: #D4A843;
    background: rgba(212, 168, 67, 0.1);
    border: 1px solid rgba(212, 168, 67, 0.2);
}

.status-badge.approved {
    color: #6CC070;
    background: rgba(108, 192, 112, 0.1);
    border: 1px solid rgba(108, 192, 112, 0.2);
}

.status-badge.rejected {
    color: #E87C6F;
    background: rgba(232, 124, 111, 0.1);
    border: 1px solid rgba(232, 124, 111, 0.2);
}

/* License key display */
.license-key-display {
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--accent);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.copy-btn {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.copy-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* Download button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    color: var(--accent);
    background: rgba(200, 168, 130, 0.03);
    border: 1.5px solid rgba(200, 168, 130, 0.35);
    border-radius: 8px;
    padding: 14px 28px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s var(--ease-out-quart);
    letter-spacing: 0.03em;
}

.download-btn:hover {
    border-color: rgba(200, 168, 130, 0.7);
    background: rgba(200, 168, 130, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(200, 168, 130, 0.1);
}

/* Profile section */
.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.profile-label {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-value {
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--text);
}

.btn-small {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 400;
    color: var(--text-tertiary);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.btn-small:hover {
    color: var(--text);
    border-color: rgba(200, 168, 130, 0.35);
}

.btn-danger {
    color: #E87C6F;
    border-color: rgba(232, 124, 111, 0.2);
}

.btn-danger:hover {
    color: #F09488;
    border-color: rgba(232, 124, 111, 0.5);
}

/* Feedback form */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feedback-textarea {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-top-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 14px 18px;
    outline: none;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.feedback-textarea:focus {
    border-color: var(--accent);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px var(--accent-muted);
}

.feedback-textarea::placeholder {
    color: var(--text-tertiary);
}

/* Changelog */
.changelog-entry {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.changelog-entry:last-child {
    border-bottom: none;
}

.changelog-date {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.changelog-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 6px;
}

.changelog-body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .dashboard-grid--with-sidebar {
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .dashboard-grid--with-sidebar .early-supporter-card {
        grid-row: auto;
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .auth-main {
        padding: 120px 24px 60px;
    }

    .auth-card {
        padding: 40px 28px;
        border-radius: 16px;
    }

    .dashboard-main {
        padding: 100px 0 60px;
    }

    .dash-card {
        padding: 32px 24px;
    }

    .license-key-display {
        font-size: 14px;
        flex-direction: column;
        text-align: center;
    }

    .profile-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nav-auth-links {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 20px;
    }
}
