:root {
    --background: #0f172a;
    --foreground: #f8fafc;
    --card: #1e293b;
    --card-foreground: #f8fafc;
    --primary: #7c3aed;
    --primary-foreground: #ffffff;
    --primary-hover: #6d28d9;
    --secondary: #1e293b;
    --secondary-foreground: #f8fafc;
    --muted: #334155;
    --muted-foreground: #94a3b8;
    --border: #334155;
    --input: #1e293b;
    --radius: 0.5rem;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-sidebar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--background);
    position: relative;
    z-index: 10;
}

.auth-hero {
    flex: 1;
    display: none;
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #2e1065 50%, #0f172a 100%);
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1024px) {
    .auth-hero {
        display: flex;
    }
}

/* Components */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: transparent;
}

.card-content {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted-foreground);
    pointer-events: none;
}

.form-input {
    width: 100%;
    height: 2.75rem;
    padding: 0 0.75rem 0 2.5rem;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.75rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
}

.btn-outline:hover {
    background-color: var(--muted);
}

.divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background-color: var(--border);
}

.divider span {
    position: relative;
    background-color: var(--card);
    padding: 0 0.75rem;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.footer-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-link a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.4;
    animation: blob 10s infinite;
}

.blob-1 {
    top: 10%;
    left: 20%;
    width: 300px;
    height: 300px;
    background-color: #7c3aed;
    animation-delay: 0s;
}

.blob-2 {
    top: 40%;
    right: 20%;
    width: 250px;
    height: 250px;
    background-color: #06b6d4;
    animation-delay: 2s;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 400px;
    color: #fff;
}

.hero-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Profile Selector */
.profile-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.profile-card:hover {
    border-color: var(--primary);
    background-color: rgba(124, 58, 237, 0.05);
}

.profile-card.selected {
    border-color: var(--primary);
    background-color: rgba(124, 58, 237, 0.1);
    box-shadow: 0 0 0 1px var(--primary);
}

.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.profile-info h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
}

.profile-info p {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ── New Auth Form (left panel) ─────────────────────────────────────────────── */

/* Grid background */
.auth-grid-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke-width='1' stroke='rgba(99%2c102%2c241%2c0.12)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");
    pointer-events: none;
}

.auth-grid-fade {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 60% 50%, rgba(15,23,42,0) 0%, rgba(15,23,42,0.92) 70%);
}

/* Form wrapper */
.auth-form-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    animation: af-fadein 0.7s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes af-fadein {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Logo */
.af-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.af-logo-icon {
    font-size: 26px;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.af-logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header */
.af-header {
    text-align: center;
    margin-bottom: 24px;
}

.af-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.af-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
}

.af-subtitle a {
    color: #818cf8;
    text-decoration: none;
    font-weight: 500;
}

.af-subtitle a:hover { text-decoration: underline; }

/* Social buttons */
.af-socials { margin-bottom: 20px; }

.af-socials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.af-social-btn {
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.af-social-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(255,255,255,0.07);
    transform: translateX(110%) translateY(110%) scale(2.5);
    border-radius: 100%;
    transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
}

.af-social-btn:hover { transform: scale(1.03); border-color: rgba(255,255,255,0.2); }
.af-social-btn:hover::before { transform: translateX(0) translateY(0) scale(2.5); }
.af-social-btn:active { transform: scale(0.97); }

.af-social-btn--full {
    grid-column: span 2;
    height: 42px;
    font-size: 0.9375rem;
}

/* Divider */
.af-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #475569;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.af-divider::before,
.af-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

/* Form fields */
.af-form-group { margin-bottom: 16px; }

.af-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 6px;
}

.af-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.af-forgot {
    font-size: 0.8125rem;
    color: #818cf8;
    text-decoration: none;
}
.af-forgot:hover { text-decoration: underline; }

.af-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.af-input::placeholder { color: #475569; }

.af-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

/* Password wrapper reuse */
.input-wrapper .af-input { padding-right: 40px; }

/* Primary button */
.af-btn-primary {
    width: 100%;
    height: 42px;
    margin-top: 4px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.35), 0 4px 14px rgba(99,102,241,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.af-btn-primary:hover {
    transform: scale(1.015);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.5), 0 6px 20px rgba(99,102,241,0.4);
}

.af-btn-primary:active {
    transform: scale(0.985);
}

/* Terms */
.af-terms {
    margin-top: 20px;
    font-size: 0.75rem;
    color: #475569;
    text-align: center;
    line-height: 1.6;
}

.af-terms a {
    color: #818cf8;
    text-decoration: none;
}
.af-terms a:hover { text-decoration: underline; }

/* Hint text */
.af-hint {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 5px;
}

/* Loading spinner for auth buttons */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes auth-spin {
    to { transform: rotate(360deg); }
}
