/* Dark Theme (Default) */
:root {
    --bg-gradient-start: #0d1117;
    --bg-gradient-end: #1a1f25;
    --card-bg: rgba(22, 27, 34, 0.9);
    --card-border: rgba(240, 246, 252, 0.06);
    --accent: #4f46e5;
    --accent-soft: rgba(79, 70, 229, 0.35);
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --input-bg: rgba(13, 17, 23, 0.9);
    --gradient-overlay: rgba(0, 0, 0, 0.3);
}

/* Light Theme */
body.light-theme {
    --bg-gradient-start: #f0f4f8;
    --bg-gradient-end: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(0, 0, 0, 0.08);
    --accent: #4f46e5;
    --accent-soft: rgba(79, 70, 229, 0.15);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --input-bg: rgba(248, 250, 252, 0.9);
    --gradient-overlay: rgba(255, 255, 255, 0.3);
}

body.light-theme {
    background: radial-gradient(circle at top left, #dbeafe 0, transparent 45%),
                radial-gradient(circle at bottom right, #e0e7ff 0, transparent 55%),
                linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at top left, #1f2937 0, transparent 45%),
                radial-gradient(circle at bottom right, #111827 0, transparent 55%),
                linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.auth-wrapper {
    max-width: 1120px;
    width: 100%;
    max-height: 100vh;
    overflow: hidden;
}

/* Animation inside illustration panel */
.illustration-animation {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.gif-container-inline {
    position: relative;
    width: 100%;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.6);
}

.gif-image,
.lottie-animation {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.gif-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(79, 70, 229, 0.08) 0%,
        rgba(6, 182, 212, 0.05) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: soft-light;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(148, 163, 184, 0.05);
    overflow: hidden;
    max-height: calc(100vh - 16px);
}

.auth-illustration {
    position: relative;
    background: radial-gradient(circle at 10% 0, #4f46e5 0, transparent 50%),
                radial-gradient(circle at 100% 90%, #06b6d4 0, transparent 55%),
                linear-gradient(145deg, #020617, #020617);
    height: 100%;
    padding: 16px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #e5e7eb;
}

.auth-illustration::before {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    opacity: 0.4;
}

.auth-illustration-inner {
    position: relative;
    z-index: 1;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.5);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #d1d5db;
}

.pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4);
}

.auth-illustration h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 8px 0 6px;
}

.auth-illustration p {
    margin: 0;
    font-size: 11px;
    color: #cbd5f5;
    line-height: 1.4;
}

.stats-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.stat-card {
    flex: 1;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.stat-label {
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
}

.progress-pill {
    margin-top: 6px;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.progress-inner {
    width: 78%;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #a3e635);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-logo-mark {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.auth-logo-text {
    display: flex;
    flex-direction: column;
}

.auth-logo-text span:first-child {
    font-size: 13px;
    font-weight: 600;
}

.auth-logo-text span:last-child {
    font-size: 10px;
    color: #9ca3af;
}

.auth-right {
    padding: 16px 20px;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.auth-right::-webkit-scrollbar {
    width: 6px;
}

.auth-right::-webkit-scrollbar-track {
    background: transparent;
}

.auth-right::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

.auth-right::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

@media (min-width: 992px) {
    .auth-right {
        padding: 20px 24px;
    }
}

.auth-header {
    margin-bottom: 12px;
}

.auth-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 3px;
}

.auth-header p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.auth-header p span {
    color: #e5e7eb;
    font-weight: 500;
}

.form-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.form-control {
    background-color: var(--input-bg);
    border: 1px solid rgba(75, 85, 99, 0.9);
    color: var(--text-main);
    font-size: 13px;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

.form-control:focus {
    background-color: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft), 0 0 0 4px rgba(79, 70, 229, 0.35);
    color: var(--text-main);
}

.form-check-label {
    font-size: 12px;
    color: var(--text-muted);
}

.form-check-input {
    border-radius: 4px;
    background-color: transparent;
    border: 1px solid rgba(75, 85, 99, 0.9);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.link-muted {
    font-size: 12px;
    color: #93c5fd;
    text-decoration: none;
}

.link-muted:hover {
    text-decoration: underline;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border: none;
    font-weight: 500;
    font-size: 13px;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.3);
    transition:
        transform 0.12s ease-out,
        box-shadow 0.12s ease-out,
        filter 0.12s ease-out,
        background-position 0.12s;
    background-size: 180% 180%;
    background-position: 0 50%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 35px rgba(56, 189, 248, 0.4);
    filter: brightness(1.05);
    background-position: 100% 50%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    width: 100%;
    border-width: 1px;
    transition: background-color 0.15s ease, border-color 0.15s ease,
        color 0.15s ease, transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.btn-google {
    background-color: #f9fafb;
    border-color: #e5e7eb;
    color: #111827;
}

.btn-google:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}

.btn-apple {
    background-color: #0f172a;
    border-color: #020617;
    color: #f9fafb;
}

.btn-apple:hover {
    background-color: #020617;
    border-color: #020617;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.6);
}

.btn-icon svg {
    width: 15px;
    height: 15px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0 6px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

.divider span {
    padding: 0 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.captcha-box {
    border-radius: 8px;
    border: 1px dashed rgba(75, 85, 99, 0.9);
    background: rgba(15, 23, 42, 0.85);
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.captcha-placeholder {
    flex: 1;
    height: 28px;
    border-radius: 6px;
    background-image: linear-gradient(
        135deg,
        rgba(55, 65, 81, 0.9),
        rgba(31, 41, 55, 0.9)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
}

.refresh-captcha {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.refresh-captcha:hover {
    color: #e5e7eb;
}

.captcha-input-wrapper {
    margin-top: 4px;
}

.captcha-input-wrapper .form-control {
    font-size: 12px;
}

.helper-text {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.helper-text a {
    color: #93c5fd;
    text-decoration: none;
}

.helper-text a:hover {
    text-decoration: underline;
}

.signup-section {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.2);
    text-align: center;
    font-size: 13px;
    color: var(--text-main);
}

.signup-section span {
    color: var(--text-muted);
    margin-right: 6px;
}

.signup-link {
    color: #60a5fa;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.signup-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Ultra-compact form-check spacing */
.form-check {
    margin-bottom: 0.35rem !important;
}

/* Password validation rules */
.password-rules {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 11px;
    transition: color 0.2s ease;
}

.rule-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    font-size: 10px;
    text-align: center;
}

.rule-valid {
    color: #22c55e;
}

.password-match {
    margin-top: 4px;
}

.match-text {
    font-size: 10px;
    font-weight: 500;
}

.match-success .match-text {
    color: #22c55e;
}

.match-error .match-text {
    color: #ef4444;
}

/* Ultra-compact spacing overrides */
.mb-3 {
    margin-bottom: 0.5rem !important;
}

.mb-4 {
    margin-bottom: 0.65rem !important;
}

.mb-2 {
    margin-bottom: 0.35rem !important;
}

.mt-2 {
    margin-top: 0.35rem !important;
}

.mt-3 {
    margin-top: 0.5rem !important;
}

.mt-4 {
    margin-top: 0.65rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.g-2 {
    --bs-gutter-x: 0.5rem !important;
    --bs-gutter-y: 0.5rem !important;
}

.d-grid {
    margin-bottom: 0.35rem !important;
}

/* Compact social buttons row */
.row.g-2 {
    margin-bottom: 0.5rem !important;
}

/* Ultra-compact d-flex spacing */
.d-flex.justify-content-between.align-items-center {
    margin-bottom: 0.5rem !important;
}

.meta-footer {
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.meta-footer a:hover {
    color: #e5e7eb;
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .auth-illustration {
        display: none;
    }

    .auth-right {
        padding: 26px 22px;
    }

    body {
        padding: 16px;
    }
}

@media (max-width: 575.98px) {
    .auth-header h1 {
        font-size: 20px;
    }

    .auth-header p {
        font-size: 12px;
    }
}

/* Theme Toggle Button */
.theme-toggle-wrapper {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
}

.theme-toggle {
    position: relative;
    width: 64px;
    height: 32px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.theme-toggle-slider {
    position: absolute;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.light-theme .theme-toggle-slider {
    left: 34px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.theme-icon {
    width: 14px;
    height: 14px;
    color: white;
}

.theme-icon-moon {
    display: block;
}

.theme-icon-sun {
    display: none;
}

body.light-theme .theme-icon-moon {
    display: none;
}

body.light-theme .theme-icon-sun {
    display: block;
}

/* Update gif overlay for light theme */
body.light-theme .gif-overlay {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.7),
        rgba(230, 240, 255, 0.6)
    );
}

/* Update progress pill for light theme */
body.light-theme .progress-pill {
    background: rgba(0, 0, 0, 0.1);
}

/* Update social buttons for light theme */
body.light-theme .social-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

body.light-theme .social-btn:hover {
    background: #f8fafc;
    border-color: var(--accent);
}

/* Update form inputs for light theme */
body.light-theme .form-control {
    background: var(--input-bg);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-main);
}

body.light-theme .form-control:focus {
    background: #ffffff;
    border-color: var(--accent);
}

/* Update signup section for light theme */
body.light-theme .signup-section {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(6, 182, 212, 0.08));
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .signup-section a {
    color: var(--accent);
}

/* Update meta-footer for light theme */
body.light-theme .meta-footer a:hover {
    color: var(--text-main);
}

@media (max-width: 768px) {
    .theme-toggle-wrapper {
        top: 16px;
        right: 16px;
    }

    .theme-toggle {
        width: 56px;
        height: 28px;
    }

    .theme-toggle-slider {
        width: 20px;
        height: 20px;
    }

    body.light-theme .theme-toggle-slider {
        left: 30px;
    }
}
