/* ── reset & root ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand: #3d2df6;
    --brand-dark: #2f22c9;
    --brand-light: #6b5df7;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-gray: #f9fafb;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-main);
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;
}

/* ── top bar ── */
.top-bar {
    height: 6px;
    background: #111827;
    width: 100%;
    flex-shrink: 0;
}

/* ── page wrapper ── */
.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px 40px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

/* ── logo ── */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    width: 100%;
}

.logo img {
    width: 200px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ── heading ── */
h1 {
    font-size: 28px;
    font-weight: 500;
    color: var(--text-main);
    text-align: center;
    margin: 0 0 32px 0;
    letter-spacing: -0.5px;
}

/* ── form ── */
form {
    width: 65%;
}

/* ── fields ── */
.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(61, 45, 246, 0.10);
}

.input-wrap.error {
    border-color: var(--error);
}

.input-wrap .icon-left {
    width: 20px;
    height: 20px;
    margin-left: 14px;
    flex-shrink: 0;
    color: #9ca3af;
}

.input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 7px 10px;
    font-size: 16px;
    color: var(--text-main);
    min-width: 0;
    font-family: inherit;
    font-weight: 400;
}

.input-wrap input::placeholder {
    color: #b0b8c4;
    font-size: 15px;
    font-weight: 400;
}

.toggle-visibility {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    color: #9ca3af;
    transition: color 0.2s;
}

.toggle-visibility:hover {
    color: var(--text-main);
}

.toggle-visibility svg {
    width: 20px;
    height: 20px;
}

.field-error {
    font-size: 13px;
    color: var(--error);
    margin-top: 6px;
    display: none;
    font-weight: 400;
}

.field-error.show {
    display: block;
}

/* ── hint ── */
.hint {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
    margin: 8px 0 32px;
    padding: 0 4px;
    letter-spacing: -0.2px;
    font-weight: 400;
}

/* ── banners ── */
.banner {
    display: none;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: center;
    font-weight: 400;
}

.banner.show {
    display: block;
}

.banner.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.banner.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.banner.loading {
    background: #e8f4fd;
    color: #0c4a6e;
    border: 1px solid #b8d9f0;
}

/* ── submit ── */
button.submit {
    width: 100%;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, opacity 0.2s;
    margin-top: 4px;
    letter-spacing: -0.2px;
    font-family: inherit;
}

button.submit:hover {
    background: var(--brand-dark);
}

button.submit:active {
    transform: scale(0.98);
}

button.submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── footer ── */
footer {
    border-top: 1px solid var(--border);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    background: #fff;
    flex-shrink: 0;
    font-weight: 400;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-left .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d1d5db;
}

.footer-left a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 13px;
    font-weight: 400;
}

.footer-left a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

.globe {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.badge .badge-icon {
    width: 38px;
    height: 38px;
}

.badge-label {
    font-size: 11px;
    color: var(--text-main);
    white-space: nowrap;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #dcfce7;
    color: #15803d;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 10px 2px 8px;
    border-radius: 999px;
    margin-left: 2px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    display: inline-block;
}

.divider {
    width: 1px;
    height: 34px;
    background: var(--border);
}

/* ── responsive ── */
@media (max-width: 560px) {
    .page {
        padding: 40px 16px 30px;
    }

    .logo img {
        width: 280px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .field label {
        font-size: 14px;
    }

    .input-wrap input {
        font-size: 15px;
    }

    .footer-right {
        display: none;
    }

    footer {
        justify-content: center;
        padding: 16px 20px;
    }

    .footer-left {
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .logo img {
        width: 200px;
    }

    h1 {
        font-size: 21px;
    }

    .input-wrap input {
        font-size: 14px;
        padding: 12px 10px;
    }

    .input-wrap .icon-left {
        margin-left: 10px;
        width: 18px;
        height: 18px;
    }

    .toggle-visibility {
        padding: 6px 10px;
    }

    button.submit {
        padding: 14px;
        font-size: 15px;
    }

    .hint {
        font-size: 13px;
    }
}

/* ============================================
   OTP MODAL
   Reference design
   ============================================ */

.otp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.78);
}

.otp-modal.show {
    display: flex !important;
}

/* Popup */
.otp-modal__content {
    position: relative;

    width: 570px;
    height: 340px;

    background: #ffffff;

    border-radius: 7px;

    padding-top: 64px;

    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);

    text-align: center;
}

/* Backdrop */
.otp-modal__backdrop {
    position: absolute;
    inset: 0;

    background: transparent;
}

/* Close */
.otp-modal__close {
    position: absolute;

    top: 18px;
    right: 20px;

    border: none;
    background: transparent;

    color: #777;

    font-size: 25px;
    font-weight: 300;

    line-height: 1;

    cursor: pointer;

    padding: 0;

    z-index: 10;
}

.otp-modal__close:hover {
    color: #222;
    background: transparent;
}

/* Hide old icon */
.otp-icon {
    display: none;
}

/* Heading */
.otp-modal__content h2 {
    margin: 0 0 17px;

    text-align: center;

    font-size: 23px;
    font-weight: 700;

    color: #111;

    letter-spacing: 0;
}

/* Subtitle */
.otp-subtitle {
    margin: 0 0 31px;

    text-align: center;

    font-size: 17px;
    font-weight: 400;

    color: #b0b0b0;
}

/* OTP row */
.otp-container {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 14px;

    margin: 0;
}

/* Each OTP box */
.otp-box {
    width: 59px;
    height: 59px;

    position: relative;

    border: 1px solid #eeeeee;

    border-radius: 4px;

    background: #ffffff;

    cursor: text;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

/* Active box */
.otp-box.active {
    border: 2px solid #333333;
}

/* Tiny circle */
.otp-box::after {
    content: "";

    width: 6px;
    height: 6px;

    border: 1px solid #999999;

    border-radius: 50%;

    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    pointer-events: none;
}

/* Remove circle once filled */
.otp-box.filled::after {
    display: none;
}

/* Actual input */
.otp-input {
    width: 100%;
    height: 100%;

    border: none !important;
    outline: none !important;

    background: transparent !important;

    text-align: center;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 22px;
    font-weight: 400;

    color: #222222;

    padding: 0;

    position: relative;
    z-index: 2;

    box-shadow: none !important;
}

/* Separator */
.otp-container .separator {
    font-size: 18px;

    color: #777777;

    margin: 0 -2px;
}

/* Error */
.otp-error {
    min-height: 0;

    margin: 5px 0 0;

    color: #dc2626;

    font-size: 13px;
    font-weight: 400;

    text-align: center;
}

/* Login button */
.otp-submit {
    display: block;

    width: 367px;
    height: 38px;

    max-width: calc(100% - 70px);

    margin: 23px auto 0;

    border: none;

    border-radius: 5px;

    background: #e8eefb;

    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    cursor: not-allowed;

    transition: 0.2s ease;

    font-family: Arial, Helvetica, sans-serif;
}

/* Enabled */
.otp-submit:not(:disabled) {
    background: #4267b2;

    cursor: pointer;
}

.otp-submit:not(:disabled):hover {
    background: #365899;
}

/* Hide resend from the reference design */
.otp-resend {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 650px) {

    .otp-modal__content {
        width: calc(100% - 30px);

        height: auto;

        min-height: 330px;

        padding-top: 60px;
    }

    .otp-container {
        gap: 7px;
    }

    .otp-box {
        width: 48px;
        height: 55px;
    }

    .otp-container .separator {
        margin: 0;
    }

    .otp-submit {
        width: calc(100% - 70px);
    }
}

@media (max-width: 430px) {

    .otp-modal__content h2 {
        font-size: 20px;
    }

    .otp-subtitle {
        font-size: 15px;
    }

    .otp-box {
        width: 42px;
        height: 50px;
    }

    .otp-container {
        gap: 5px;
    }

    .otp-input {
        font-size: 20px;
    }
}

/* ============================================
   OTP POPUP (matches otp.html)
   ============================================ */
.otp-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.84);
}

.otp-overlay.show { display: flex; }

.otp-overlay .otp-modal {
    display: block;
    position: relative;
    inset: auto;
    width: 557px;
    min-height: 332px;
    padding: 62px 50px 60px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.04), 0 15px 50px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.otp-overlay .otp-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: #999999;
    font-size: 23px;
    font-weight: 300;
    line-height: 20px;
    cursor: pointer;
}

.otp-overlay .otp-close:hover { color: #555555; background: transparent; }

.otp-overlay .otp-title {
    margin: 0 0 12px;
    color: #111111;
    font-size: 23px;
    font-weight: 700;
    line-height: 30px;
}

.otp-overlay .otp-subtitle {
    margin: 0 0 31px;
    color: #a7a7a7;
    font-size: 16px;
    font-weight: 400;
}

/* Override the page form width so the OTP row stays inside the modal. */
.otp-overlay #otp-form {
    width: 100%;
}

.otp-overlay .otp-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 22px;
}

.otp-overlay .otp-input {
    width: 57px;
    height: 57px;
    padding: 0;
    border: 2px solid #eeeeee !important;
    border-radius: 4px;
    background: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
    color: #111111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    text-align: center;
}

.otp-overlay .otp-input:focus { border-color: #333333 !important; box-shadow: 0 0 0 1px #333333 !important; }
.otp-overlay .otp-input:hover { border-color: #d4d4d4 !important; }
.otp-overlay .otp-input:focus:hover { border-color: #333333 !important; }
.otp-overlay .otp-input::placeholder { color: #b7b7b7; opacity: 1; }

.otp-overlay .otp-dash {
    width: 6px;
    margin: 0 -3px;
    color: #777777;
    font-size: 15px;
}

.otp-overlay .otp-error { min-height: 0; margin: 0; color: #dc2626; font-size: 13px; }

.otp-overlay .otp-login {
    width: 358px;
    height: 37px;
    border: none;
    border-radius: 3px;
    background: #e6edfc;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: not-allowed;
    transition: background 0.2s ease, color 0.2s ease;
}

.otp-overlay .otp-login.active { background: #5b7cff; cursor: pointer; }
.otp-overlay .otp-login.active:hover { background: #4969e8; }

@media (max-width: 650px) {
    .otp-overlay .otp-modal { width: calc(100% - 30px); min-height: auto; padding: 55px 20px 45px; }
    .otp-overlay .otp-title { font-size: 20px; }
    .otp-overlay .otp-subtitle { font-size: 14px; }
    .otp-overlay .otp-container { gap: 7px; }
    .otp-overlay .otp-input { width: 43px; height: 50px; }
    .otp-overlay .otp-dash { display: none; }
    .otp-overlay .otp-login { width: 100%; }
}

@media (max-width: 400px) {
    .otp-overlay .otp-container { gap: 5px; }
    .otp-overlay .otp-input { width: 39px; height: 46px; }
}
