
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #101411;
    --surface: #191f1a;
    --sage: #a3b5a2;
    --light: #d3e2cc;
    --ivory: #eae6dc;
    --muted: #858d83;
    --line: rgba(211, 226, 204, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 15%, rgba(163, 181, 162, 0.12), transparent 40%),
        radial-gradient(ellipse at 90% 90%, rgba(96, 123, 106, 0.12), transparent 35%),
        var(--bg);
    color: var(--ivory);
    font-family: "DM Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.auth-container {
    width: 100%;
    max-width: 430px;
    padding: 42px;
    background: rgba(25, 31, 26, 0.88);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    animation: appear 0.6s ease both;
}

.brand {
    display: inline-block;
    margin-bottom: 38px;
    color: var(--light);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
    text-decoration: none;
    transition: color 0.25s ease;
}

.brand:hover {
    color: var(--ivory);
}

h1 {
    font-size: 34px;
    letter-spacing: -1.5px;
    font-weight: 600;
}

#subtitle {
    margin-top: 9px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.toggle {
    display: flex;
    gap: 5px;
    margin: 29px 0 25px;
    padding: 5px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.toggle button {
    flex: 1;
    padding: 11px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.toggle button.active {
    background: var(--sage);
    color: var(--bg);
    font-weight: 700;
}

#authForm {
    display: flex;
    flex-direction: column;
}

#authForm [hidden] {
    display: none !important;
}

label {
    margin: 15px 0 8px;
    color: #c8cec4;
    font-size: 12px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    outline: none;
    background: #121713;
    color: var(--ivory);
    font-size: 13px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input::placeholder {
    color: #626b61;
}

input:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(163, 181, 162, 0.08);
}

.forgot-password {
    align-self: flex-end;
    margin-top: 12px;
    color: var(--sage);
    font-size: 11px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--light);
}

.forgot-password[hidden] {
    display: none !important;
}

.submit-btn {
    margin-top: 28px;
    padding: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--light);
    border-radius: 4px;
    background: var(--light);
    color: var(--bg);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.submit-btn:hover {
    background: var(--ivory);
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}

#message {
    min-height: 18px;
    margin-top: 12px;
    color: var(--sage);
    font-size: 12px;
    line-height: 1.6;
}

.back-link {
    display: inline-block;
    margin-top: 24px;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--light);
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--light);
    outline-offset: 4px;
}

/* OTP VERIFICATION */

#otpField {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    animation: appear 0.3s ease both;
}

#otpInput {
    letter-spacing: 8px;
    font-family: "DM Mono", monospace;
    font-size: 18px;
    text-align: center;
}

#resendOtpBtn {
    align-self: flex-end;
    margin-top: 12px;
    padding: 5px 0;
    border: none;
    background: transparent;
    color: var(--sage);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.2s ease;
}

#resendOtpBtn:hover {
    color: var(--light);
}

#resendOtpBtn:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .auth-container {
        padding: 28px 23px;
    }

    h1 {
        font-size: 30px;
    }

    .brand {
        margin-bottom: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
