/* =====================================================
       ROOT VARIABLES (CENTRALIZED DESIGN SYSTEM)
    ===================================================== */
:root {
    /* FONTS */
    --heading-font: "Josefin Sans", sans-serif;
    --body-font: "Jost", sans-serif;

    /* COLORS */
    --color-white: #fff;
    --color-black: #000;
    --color-primary: #111;
    --color-secondary: #222;
    --color-text-muted: #888;
    --color-text-light: #555;
    --color-text-gray: #666;
    --color-border: #eaeaea;
    --color-border-light: #e5e5e5;
    --color-border-extralight: #f2f2f2;
    --color-bg-light: #f7f7f7;
    --color-accent: #e11;

    /* SHADOWS */
    --shadow-soft: 0 20px 40px rgba(0, 0, 0, .08);
    --shadow-button: 0 6px 16px rgba(0, 0, 0, .15);
    --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.15);

    /* TRANSITIONS */
    --transition-fast: 0.25s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.35s ease;
    --transition-slower: 0.6s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    color: var(--color-primary);
    background: var(--color-bg-light);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--heading-font);
}

/* Background Pattern */
.login-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 50%, #e8e8e8 100%);
    z-index: -1;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(225, 17, 17, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(17, 17, 17, 0.02) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-2%, -2%) rotate(1deg);
    }
}

/* Decorative Elements */
.deco-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.deco-circle-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(225, 17, 17, 0.05), transparent);
    top: -100px;
    right: -100px;
}

.deco-circle-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(17, 17, 17, 0.03), transparent);
    bottom: -50px;
    left: -50px;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Login Card */
.login-card {
    background: var(--color-white);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    position: relative;
}

.login-card-inner {
    padding: 48px 40px;
}

@media (max-width: 480px) {
    .login-card-inner {
        padding: 32px 24px;
    }
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Step Container */
.step-container {
    display: none;
    animation: fadeInUp 0.5s ease forwards;
}

.step-container.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-family: var(--body-font);
    font-size: 15px;
    color: var(--color-primary);
    background: var(--color-white);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.05);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

/* Email Input with Icon */
.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.input-with-icon .form-input {
    padding-left: 48px;
}

.input-with-icon:focus-within .input-icon {
    color: var(--color-primary);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--heading-font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-gray);
    border: none;
    font-size: 13px;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    color: var(--color-primary);
}

/* OTP Input */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 32px 0;
}

.otp-input {
    width: 56px;
    height: 64px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-family: var(--heading-font);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    color: var(--color-primary);
    background: var(--color-white);
    transition: all var(--transition-fast);
    caret-color: var(--color-accent);
}

.otp-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.05);
    transform: translateY(-2px);
}

.otp-input.filled {
    background: var(--color-bg-light);
    border-color: var(--color-primary);
}

.otp-input.error {
    border-color: var(--color-accent);
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

@media (max-width: 400px) {
    .otp-input {
        width: 48px;
        height: 56px;
        font-size: 20px;
    }

    .otp-container {
        gap: 8px;
    }
}


@media (max-width: 380px) {
    .otp-input {
        width: 40px;
        height: 56px;
        font-size: 19px;
    }

    .otp-container {
        gap: 8px;
    }
}


/* Timer */
.timer-container {
    text-align: center;
    margin-bottom: 24px;
}

.timer-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-bg-light);
    border-radius: 50px;
    font-family: var(--heading-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-gray);
}

.timer-display.warning {
    background: rgba(225, 17, 17, 0.1);
    color: var(--color-accent);
}

.timer-display.expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-cancelled);
}

.timer-icon {
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Email Display */
.email-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-bg-light);
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--color-text-gray);
}

.email-display .email {
    font-weight: 500;
    color: var(--color-primary);
}

/* Links */
.link {
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
    cursor: pointer;
}

.link:hover {
    color: var(--color-accent);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer */
.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-extralight);
    margin-top: 32px;
}

.login-footer p {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Message Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-card);
    z-index: 1000;
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #22c55e;
}

.toast.error {
    background: var(--color-accent);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Demo OTP Display (for testing) */
.demo-otp {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    white-space: nowrap;
}