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

:root {
    --glass-bg: rgba(20, 27, 45, 0.65);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --accent-primary: #a855f7;
    --accent-secondary: #d946ef;
    --accent-glow: rgba(168, 85, 247, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: rgba(168, 85, 247, 0.5);
    --error: #f43f5e;
    --error-bg: rgba(244, 63, 94, 0.15);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
}

body {
    font-family: "Inter", "Poppins", sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(135deg, #0f0c1e 0%, #1a1025 25%, #1a1a2e 50%, #16213e 75%, #0f172a 100%);
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(168, 85, 247, 0.03) 0px,
            rgba(168, 85, 247, 0.03) 2px,
            transparent 2px,
            transparent 8px
        ),
        repeating-linear-gradient(
            135deg,
            rgba(217, 70, 239, 0.03) 0px,
            rgba(217, 70, 239, 0.03) 2px,
            transparent 2px,
            transparent 8px
        ),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1.5" fill="rgba(168,85,247,0.08)"/><circle cx="80" cy="40" r="1" fill="rgba(217,70,239,0.08)"/><circle cx="50" cy="85" r="1.5" fill="rgba(168,85,247,0.08)"/><circle cx="90" cy="75" r="1" fill="rgba(217,70,239,0.08)"/><circle cx="10" cy="70" r="1" fill="rgba(168,85,247,0.08)"/></svg>');
    background-repeat: repeat;
    background-size:
        60px 60px,
        60px 60px,
        40px 40px;
    pointer-events: none;
    opacity: 0.5;
}

body::after {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 40%,
        rgba(168, 85, 247, 0.15) 0%,
        rgba(217, 70, 239, 0.08) 30%,
        transparent 60%
    );
    animation: orbMove 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes orbMove {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(5%, 3%) rotate(120deg);
    }
    66% {
        transform: translate(-3%, 5%) rotate(240deg);
    }
}

.login-container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.4);
    border-color: rgba(168, 85, 247, 0.3);
}

.card-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    background-size: 200% 100%;
    animation: accentMove 3s ease-in-out infinite;
}

@keyframes accentMove {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.card-header {
    padding: 40px 32px 24px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h1 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0px;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #fff, var(--accent-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.card-body {
    padding: 32px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 24px;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(4px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert i {
    margin-top: 2px;
    font-size: 14px;
    flex-shrink: 0;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: scale(1.2);
}

.step-dot.done {
    background: var(--success);
}

.step-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
    font-weight: 500;
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.form-group {
    margin-bottom: 22px;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--accent-primary);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.input-field {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 16px;
    font-size: 14px;
    font-family: "Inter", sans-serif;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.input-field:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.12);
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.password-toggle {
    position: absolute;
    right: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
    z-index: 1;
}

.password-toggle:hover {
    color: var(--accent-primary);
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -8px var(--accent-glow);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.spinner {
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.footer-link {
    text-align: center;
    margin-top: 24px;
}

.footer-link a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-link a:hover {
    color: var(--accent-primary);
}

.otp-hint {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.6;
}

.otp-hint strong {
    color: var(--accent-primary);
}

.otp-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.otp-input {
    width: 50px;
    height: 50px;
    border: 1.5px solid var(--input-border);
    border-radius: 16px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--input-bg);
    transition: all 0.2s ease;
    outline: none;
    font-family: "Inter", monospace;
}

.otp-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    transform: scale(1.02);
}

.otp-input.filled {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.timer-count {
    font-weight: 700;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
    font-family: monospace;
    font-size: 14px;
}

.timer-count.expired {
    color: var(--error);
}

.text-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
    font-family: "Inter", sans-serif;
}

.resend-btn {
    color: var(--accent-primary);
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.resend-btn.visible {
    opacity: 1;
    pointer-events: all;
}

.resend-btn:hover {
    color: var(--accent-secondary);
}

.back-btn {
    color: var(--text-secondary);
    margin-top: 12px;
}

.back-btn:hover {
    color: var(--text-primary);
}

.card-footer-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    background-size: 200% 100%;
    animation: accentMove 3s ease-in-out infinite;
    opacity: 0.5;
}

@media (max-width: 640px) {
    body {
        padding: 16px;
        align-items: flex-start;
        padding-top: 50px;
    }

    .card-header {
        padding: 32px 24px 20px;
    }

    .card-body {
        padding: 24px;
    }

    .card-header h1 {
        font-size: 24px;
    }

    .otp-input {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .otp-group {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .otp-input {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .otp-group {
        gap: 8px;
    }
}

@media (max-width: 380px) {
    .otp-input {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .otp-group {
        gap: 6px;
    }
}

.logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.logo-wrap img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.35);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
}

.remember-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.remember-label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.is-hidden {
    display: none;
}
