*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans", sans-serif;
    background-color: #0a1123;
    background-image: url("{% static 'images/bg.png' %}");
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    color: #0e1629;
}

.auth-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px 60px;
}

.auth-wrap {
    width: 100%;
    max-width: 440px;
}

/* Brand */
.auth-brand {
    text-align: center;
    margin-bottom: 26px;
}

.auth-brand-name {
    font-size: 22px;
    font-weight: 800;
    color: #d4a263;
}

.auth-brand-sub {
    font-size: 12px;
    color: #a8a5a0;
    margin-top: 2px;
}

/* Messages */
.auth-messages {
    margin-bottom: 14px;
}

.auth-msg {
    padding: 11px 15px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-msg.error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.auth-msg.success {
    background: #dcf5e0;
    color: #166534;
    border: 1px solid #86efac;
}

/* Card */
.auth-card {
    background: #ffffff;
    border: 1px solid #e7e4db;
    border-radius: 18px;
    padding: 32px 32px 36px;
    box-shadow: 0 10px 40px rgba(10, 17, 35, 0.2);
    width: 100%;
}

/* Top row */
.auth-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.auth-mode-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0a1123;
    display: flex;
    align-items: center;
    gap: 7px;
}

.auth-mode-label::before {
    content: '';
    width: 20px;
    height: 2px;
    background: #d4a263;
    border-radius: 2px;
}

.auth-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #f1ece6;
    border: 1.5px solid #e7e4db;
    border-radius: 20px;
    font-family: "Noto Sans", sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: #0e1629;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.auth-switch-btn:hover {
    background: #0a1123;
    border-color: #0a1123;
    color: #fff;
}

/* Panels */
.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-panel-title {
    font-size: 23px;
    font-weight: 800;
    color: #0e1629;
    margin-bottom: 5px;
}

.auth-panel-sub {
    font-size: 13px;
    color: #a8a5a0;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Steps */
.auth-step {
    display: none;
    flex-direction: column;
}

.auth-step.active {
    display: flex;
}

/* OTP sent banner */
.otp-sent-info {
    background: #f1ece6;
    border: 1px solid #e7e4db;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    color: #0a1123;
    font-weight: 600;
    margin-bottom: 18px;
}

/* Field */
.auth-field {
    margin-bottom: 14px;
    width: 100%;
}

.auth-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a8a5a0;
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #e7e4db;
    border-radius: 9px;
    font-family: "Noto Sans", sans-serif;
    font-size: 14px;
    color: #0e1629;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.auth-input:focus {
    border-color: #d4a263;
    box-shadow: 0 0 0 3px rgba(212, 162, 99, .18);
}

.auth-input::placeholder {
    color: #a8a5a0;
}

.auth-input.err {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, .1);
}

.field-error {
    font-size: 11.5px;
    color: #e53e3e;
    font-weight: 600;
    margin-top: 4px;
    display: none;
}

.field-error.show {
    display: block;
}

/* ── OTP boxes — constrained inside card ── */
.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
    width: 100%;
    margin-bottom: 6px;
}

.otp-box {
    width: 100%;
    height: 52px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: #0e1629;
    border: 1.5px solid #e7e4db;
    border-radius: 9px;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    padding: 0;
}

.otp-box:focus {
    border-color: #d4a263;
    box-shadow: 0 0 0 3px rgba(212, 162, 99, .18);
}

.otp-box.filled {
    border-color: #d4a263;
    background: #f1ece6;
}

/* Timer row */
.otp-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 12.5px;
}

.otp-timer {
    color: #a8a5a0;
    font-weight: 600;
}

.otp-timer span {
    color: #0a1123;
    font-weight: 800;
}

/* Resend — plain button, NOT inside a form */
.btn-resend {
    background: none;
    border: none;
    font-family: "Noto Sans", sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    color: #cbc7bd;
    cursor: not-allowed;
    padding: 0;
}

.btn-resend.can-resend {
    color: #0a1123;
    cursor: pointer;
    text-decoration: underline;
}

/* Submit */
.btn-auth-submit {
    width: 100%;
    padding: 13px;
    background: #0a1123;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-family: "Noto Sans", sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background .2s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 4px;
}

.btn-auth-submit:hover {
    background: #d4a263;
    color: #0a1123;
    transform: translateY(-1px);
}

/* Back */
.auth-back {
    background: none;
    border: none;
    font-family: "Noto Sans", sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    color: #a8a5a0;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .2s;
}

.auth-back:hover {
    color: #0a1123;
}

/* Home link */
.auth-home-link {
    text-align: center;
    margin-top: 22px;
}

.auth-home-link a {
    font-size: 13px;
    font-weight: 700;
    color: #a8a5a0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
}

.auth-home-link a:hover {
    color: #d4a263;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 16px 28px;
    }

    .otp-box {
        height: 44px;
        font-size: 16px;
    }

    .otp-boxes {
        gap: 5px;
    }
}