/* FaceTrace AI — Design system (Jost) */

@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --font: 'Jost', system-ui, sans-serif;
    --accent: #06b6d4;
    --accent-2: #8b5cf6;
    --accent-3: #ec4899;
    --surface: rgba(15, 23, 42, 0.65);
    --border: rgba(255, 255, 255, 0.09);
    --text-muted: #94a3b8;
    --radius: 1rem;
    --radius-lg: 1.25rem;
    --shadow-glow: 0 0 60px rgba(6, 182, 212, 0.12);
}

*, *::before, *::after {
    font-family: var(--font);
}

body {
    font-family: var(--font);
    letter-spacing: 0.01em;
}

/* Glass panels */
.glass {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glow);
}

.glass-strong {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #0f172a;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(6, 182, 212, 0.35);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9375rem;
    background: transparent;
    color: #e2e8f0;
    border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s;
}

.btn-secondary:hover {
    border-color: rgba(6, 182, 212, 0.5);
    background: rgba(6, 182, 212, 0.08);
}

/* Form fields */
.field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    letter-spacing: 0.03em;
}

.field-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #f1f5f9;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--border);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field-input::placeholder {
    color: #64748b;
}

.field-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.field-input:focus {
    border-color: rgba(6, 182, 212, 0.6);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
    background: rgba(2, 6, 23, 0.7);
}

.field-group {
    margin-bottom: 1.25rem;
}

/* Auth layout */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .auth-shell {
        grid-template-columns: 1fr 1fr;
    }
}

.auth-brand {
    display: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 40%, #0c4a6e 100%);
    padding: 3rem;
}

@media (min-width: 1024px) {
    .auth-brand {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(6, 182, 212, 0.25), transparent),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139, 92, 246, 0.2), transparent);
    pointer-events: none;
}

.auth-brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black 20%, transparent 90%);
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: #020617;
    position: relative;
}

.auth-form-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08), transparent 70%);
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
}

.auth-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #22d3ee, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Page headers */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.page-header .gradient-text {
    background: linear-gradient(135deg, #67e8f9, #c4b5fd, #f9a8d4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.0625rem;
    font-weight: 400;
    margin-top: 0.75rem;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

/* Content cards */
.content-card {
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.content-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #22d3ee;
    margin-bottom: 1rem;
}

.legal-prose {
    color: #cbd5e1;
    font-size: 0.9375rem;
    line-height: 1.75;
}

.legal-prose h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-prose ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.legal-prose a {
    color: #22d3ee;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Alert */
.alert-error {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    margin-bottom: 1.25rem;
}

.alert-success {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

/* Install wizard */
.install-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: #020617;
    position: relative;
    overflow: hidden;
}

.install-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.install-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.install-bg .orb-1 { width: 400px; height: 400px; top: -10%; right: -5%; background: rgba(6, 182, 212, 0.2); }
.install-bg .orb-2 { width: 320px; height: 320px; bottom: 10%; left: -5%; background: rgba(139, 92, 246, 0.18); }
.install-bg .orb-3 { width: 200px; height: 200px; top: 50%; left: 40%; background: rgba(236, 72, 153, 0.1); }

.install-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    padding: 2.5rem;
    border-radius: 1.5rem;
}

.install-steps {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.install-step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s;
}

.install-step.active {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.install-step.done {
    background: var(--accent);
}

.check-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

.check-list .ok { color: #4ade80; }
.check-list .fail { color: #f87171; }

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #f1f5f9;
}

.install-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .install-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Dashboard & pricing cards */
.feature-card {
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(6, 182, 212, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.pricing-card {
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: transform 0.25s;
}

.pricing-card:hover {
    transform: translateY(-4px);
}

.pricing-card.featured {
    border: 2px solid rgba(6, 182, 212, 0.45);
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.15);
}

.badge-popular {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
}

/* Masonry & upload */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.result-card {
    animation: fadeIn 0.5s ease forwards;
}

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

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

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

.progress-track {
    height: 6px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.upload-zone {
    transition: all 0.3s ease;
}

/* Nav refinement */
.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #22d3ee;
}

/* Light mode */
html:not(.dark) body {
    background: #f8fafc;
    color: #0f172a;
}

html:not(.dark) .glass,
html:not(.dark) .glass-strong {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

html:not(.dark) .field-input {
    background: #fff;
    color: #0f172a;
    border-color: #e2e8f0;
}

html:not(.dark) .auth-form-panel,
html:not(.dark) .install-shell {
    background: #f8fafc;
}

html:not(.dark) .legal-prose {
    color: #475569;
}
