/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface-2: #1a1a26;
    --surface-3: #22222e;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #f0f0f5;
    --text-muted: #8a8a9a;
    --text-dim: #5a5a6a;
    --accent: #ff6b6b;
    --accent-2: #ffa07a;
    --gradient: linear-gradient(135deg, #ff6b6b, #ffa07a);
    --glow: rgba(255, 107, 107, 0.15);
    --success: #4ade80;
    --error: #f87171;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.hidden {
    display: none !important;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.2), transparent 70%);
    top: -200px;
    right: -200px;
    animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 160, 122, 0.15), transparent 70%);
    bottom: 20%;
    left: -200px;
    animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 130, 255, 0.1), transparent 70%);
    top: 50%;
    right: 10%;
    animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-60px, 80px); }
    66% { transform: translate(40px, -40px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(80px, -50px); }
    66% { transform: translate(-30px, 60px); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-70px, 50px); }
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    padding: 12px 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.15rem;
}

.nav-logo {
    height: 48px;
    width: auto;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s;
    border-radius: 1px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ===== MOBILE MENU BUTTON ===== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== MAIN LOGIN LAYOUT ===== */
.login-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 32px 60px;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.02);
    animation: cardIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== HERO SIDE PANEL ===== */
.login-hero-panel {
    position: relative;
    background: linear-gradient(160deg, #14141e 0%, #0e0e16 100%);
    padding: 60px 48px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-panel-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.08), transparent 65%);
    bottom: -150px;
    left: -100px;
    pointer-events: none;
    animation: panelGlow 15s ease-in-out infinite;
}

@keyframes panelGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.1); }
}

.hero-panel-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-2);
    margin-bottom: 32px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

.hero-panel-content h2 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}

.hero-panel-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 340px;
    margin-bottom: 40px;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 107, 107, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

/* ===== LOGIN CARD ===== */
.login-card {
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-step {
    animation: stepFade 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes stepFade {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== LOGIN HEADER ===== */
.login-header {
    margin-bottom: 36px;
}

.login-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: rgba(255, 107, 107, 0.06);
    border: 1px solid rgba(255, 107, 107, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 24px;
    transition: all 0.4s;
}

.login-icon-wrapper.otp-icon {
    background: rgba(74, 222, 128, 0.06);
    border-color: rgba(74, 222, 128, 0.1);
    color: var(--success);
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.login-header p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.login-header p strong {
    color: var(--accent-2);
    font-weight: 600;
}

/* ===== FORM ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-group label svg {
    color: var(--accent);
    opacity: 0.7;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

.form-group input:focus {
    border-color: var(--accent);
    background: var(--surface-3);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.08), 0 8px 24px rgba(0, 0, 0, 0.15);
}

.form-group input:hover {
    border-color: var(--border-hover);
}

.form-group input.input-error {
    border-color: var(--error) !important;
    background: rgba(248, 113, 113, 0.04) !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.08);
}

/* ===== OTP INPUT GROUP ===== */
.otp-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    transition: all 0.3s;
}

.otp-box {
    width: 52px;
    height: 62px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Inter', monospace;
    letter-spacing: 0;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    caret-color: var(--accent);
}

.otp-box:focus {
    border-color: var(--accent);
    background: var(--surface-3);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1), 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.otp-box:hover:not(:focus) {
    border-color: var(--border-hover);
}

.otp-box.otp-error {
    border-color: var(--error) !important;
    background: rgba(248, 113, 113, 0.04);
    animation: boxShake 0.3s ease-in-out;
}

@keyframes boxShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.otp-separator {
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.otp-dash {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: var(--text-dim);
    opacity: 0.4;
}

/* Shake animation for OTP group */
.otp-input-group.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ===== ERROR BANNER ===== */
.error-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.18);
    border-radius: 12px;
    margin-bottom: 20px;
    animation: bannerIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bannerIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.error-banner.shake {
    animation: bannerIn 0.3s cubic-bezier(0.4, 0, 0.2, 1), shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0.1s;
}

.error-banner-icon {
    flex-shrink: 0;
    color: var(--error);
    display: flex;
    align-items: center;
}

.error-banner p {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--error);
    line-height: 1.4;
}

.error-banner-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.error-banner-close:hover {
    color: var(--error);
    background: rgba(248, 113, 113, 0.08);
}

/* ===== BUTTONS ===== */
.btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 36px;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px var(--glow);
    position: relative;
    overflow: hidden;
}

.btn-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s;
}

.btn-main:hover::before {
    left: 100%;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px var(--glow);
}

.btn-main:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-main:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-main:disabled::before {
    display: none;
}

.btn-full {
    width: 100%;
}

.btn-main svg {
    transition: transform 0.3s;
}

.btn-main:hover:not(:disabled) svg {
    transform: translateX(3px);
}

.btn-main.loading {
    pointer-events: none;
}

.btn-main.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    right: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== OTP ACTIONS ===== */
.otp-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 12px;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s;
}

.btn-text:hover:not(:disabled) {
    color: var(--accent-2);
    background: rgba(255, 160, 122, 0.05);
}

.btn-text:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-text svg {
    transition: transform 0.3s;
}

.btn-text:hover:not(:disabled) svg {
    transform: rotate(-45deg);
}

/* ===== LOGIN FOOTER TEXT ===== */
.login-footer-text {
    margin-top: 32px;
    text-align: center;
}

.login-footer-text p {
    font-size: 0.88rem;
    color: var(--text-dim);
}

.login-footer-text a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    position: relative;
}

.login-footer-text a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--gradient);
    transition: width 0.3s;
}

.login-footer-text a:hover {
    color: var(--accent);
}

.login-footer-text a:hover::after {
    width: 100%;
}

/* ===== SUCCESS CONTAINER ===== */
.success-container {
    text-align: center;
    animation: successIn 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes successIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-checkmark {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.08);
    border: 2px solid rgba(74, 222, 128, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    color: var(--success);
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.15); }
    50% { box-shadow: 0 0 0 16px rgba(74, 222, 128, 0); }
}

.success-container h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    line-height: 1.2;
}

.success-container p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.success-info {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
}

.success-detail {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.detail-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent-2);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border-radius: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    z-index: 200;
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.toast.hidden {
    display: none !important;
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.2);
}

.toast.error .toast-icon {
    color: var(--error);
}

.toast.success {
    border-color: rgba(74, 222, 128, 0.2);
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== FOOTER ===== */
.footer {
    padding: 60px 0 40px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.footer-brand .nav-logo {
    height: 60px;
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-bottom {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .login-hero-panel {
        display: none;
    }

    .login-card {
        padding: 44px 32px;
    }
}

@media (max-width: 640px) {
    .login-main {
        padding: 120px 16px 40px;
    }

    .login-card {
        padding: 36px 24px;
    }

    .login-container {
        border-radius: 20px;
    }

    .login-header h1 {
        font-size: 1.7rem;
    }

    .otp-box {
        width: 44px;
        height: 54px;
        font-size: 1.2rem;
        border-radius: 10px;
    }

    .otp-input-group {
        gap: 6px;
    }

    .otp-separator {
        padding: 0 2px;
    }

    .otp-dash {
        width: 10px;
    }

    .nav-brand, .mobile-menu-btn {
        position: relative;
        z-index: 102;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        display: none;
    }

    .nav-links.active {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(10, 10, 15, 0.92);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        padding: 120px 40px 40px;
        gap: 28px;
        z-index: 99;
        box-shadow: none;
        overflow-y: auto;
    }

    .nav-links.active a {
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
        padding: 12px 0;
        color: var(--text-muted);
    }

    .nav-links.active a:hover {
        color: var(--text);
    }

    .nav-links.active a.active {
        color: var(--text);
    }

    .nav-links.active a::after {
        display: none;
    }

    .otp-actions {
        flex-direction: column;
        gap: 6px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .login-card {
        padding: 28px 18px;
    }

    .otp-box {
        width: 38px;
        height: 48px;
        font-size: 1.1rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }
}
