/* ===== VARIABLES ===== */
:root {
    --bg: #f7f9fc;
    --card: #fff;
    --muted: #6b7280;
    --text: #111827;
    --b: #e5e7eb;
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --ok: #16a34a;
    --err: #dc2626;
    --radius: 20px;
    --shadow: 0 10px 25px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
}

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

html, body {
    font: 14px/1.6 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    position: relative;
}

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

/* ===== BACKGROUND PATTERN ===== */
.bg-pattern {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: var(--bg);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(37, 99, 235, 0.02) 0%, transparent 50%);
}

.bg-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(37, 99, 235, 0.01) 35px, rgba(37, 99, 235, 0.01) 70px);
    animation: backgroundMove 60s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(70px, 70px); }
}

/* ===== GEOMETRIC SHAPES ===== */
.geometric-shapes {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    opacity: 0.03;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), transparent);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: -200px;
    right: -100px;
    animation: float1 20s infinite ease-in-out;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, var(--primary), transparent);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    bottom: -150px;
    left: -50px;
    animation: float2 25s infinite ease-in-out;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--primary);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    top: 40%;
    left: 10%;
    animation: float3 30s infinite ease-in-out;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-50px, 50px) rotate(180deg); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(50px, -50px) rotate(-180deg); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

/* ===== HEADER ===== */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--b);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
    position: relative;
    z-index: 10;
}

/* ===== AUTH WRAPPER (Single Panel) ===== */
.auth-wrapper {
    width: 100%;
    max-width: 500px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.08),
        0 0 0 1px rgba(37, 99, 235, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease;
}

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

/* ===== TAB NAVIGATION ===== */
.auth-tabs {
    display: flex;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    position: relative;
}

.tab-btn {
    flex: 1;
    padding: 18px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn.active {
    color: white;
}

.tab-btn:hover {
    color: white;
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
    width: 50%;
    left: 0;
}

.tab-indicator.right {
    left: 50%;
}

/* ===== AUTH CONTENT ===== */
.auth-content {
    padding: 40px;
}

.auth-form {
    display: none !important;
}

.auth-form.active {
    display: block !important;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--muted);
    font-size: 16px;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-input {
    width: 100%;
    border: 2px solid var(--b);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg);
}

.form-input:hover {
    background: white;
    border-color: rgba(37, 99, 235, 0.2);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input.error {
    border-color: var(--err);
}

/* ===== BUTTONS ===== */
.btn {
    border: 0;
    border-radius: 12px;
    padding: 14px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 16px;
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    animation: alertSlide 0.4s ease;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert.error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
}

.alert.success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* ===== FORM FOOTER ===== */
.form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--b);
    color: var(--muted);
    font-size: 14px;
}

.form-footer a {
    color: var(--primary);
    font-weight: 600;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: var(--primary-2);
}

/* ===== URL PREFILL ===== */
.prefill-notice {
    background: var(--primary-light);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--muted);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--b);
}

.divider span {
    padding: 0 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-container {
        padding: 90px 20px 40px;
    }

    .auth-content {
        padding: 30px 20px;
    }

    .form-title {
        font-size: 24px;
    }
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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