:root {
    --brand-blue: #2293c3;
    --brand-blue-hover: #1d82ad;
    --ink: #12263f;
    --title: #182b34;
    --muted: #647177;
    --input-border: #d2ddec;
    --white: #ffffff;
    --danger-bg: #fdecea;
    --danger-text: #b3261e;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: #f9fbfd;
    -webkit-font-smoothing: antialiased;
}

/* Blue radial gradient + noise texture — taken from the live ClickSend page */
.bg {
    min-height: 100vh;
    background-image: url("/static/noise.svg"),
        radial-gradient(
            60.18% 80.78% at 50% 36.15%,
            #e1f4f9 0%,
            #b3e2ef 15%,
            #3eaed6 60%,
            #1980b0 100%
        );
    background-repeat: repeat, no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 56px 24px 0;
}

.logo {
    width: 309px;
    height: 59px;
    max-width: 80vw;
}

.lang {
    position: absolute;
    right: 28px;
    top: 52px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid #e3e8ee;
    border-radius: 6px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
}

.lang::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #9aa6b2;
}

.card {
    width: 608px;
    max-width: calc(100vw - 32px);
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 3px 50px rgba(0, 0, 0, 0.08);
    margin: 80px 0 60px;
}

.card__inner {
    padding: 48px 64px 56px;
}

.title {
    font-family: "Montserrat", sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--title);
    text-align: center;
    margin: 0 0 10px;
}

.subtitle {
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    color: #000000;
    margin: 0 0 30px;
}

.alert {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 20px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.field__label {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.field__link {
    font-size: 12px;
    font-weight: 400;
    color: var(--brand-blue);
    text-decoration: none;
}

.field__link:hover {
    text-decoration: underline;
}

.field__control {
    position: relative;
}

.field__input {
    width: 100%;
    height: 41px;
    padding: 8px 12px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__control .field__input {
    padding-right: 42px;
}

.field__input::placeholder {
    color: #95a0ab;
}

.field__input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(34, 147, 195, 0.15);
}

.toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #8a949e;
    cursor: pointer;
    padding: 2px;
}

.toggle:hover {
    color: var(--ink);
}

.link {
    color: var(--brand-blue);
    text-decoration: underline;
    font-weight: 400;
}

.link:hover {
    text-decoration: none;
}

.btn {
    height: 48px;
    border: none;
    border-radius: 8px;
    background: var(--brand-blue);
    color: var(--white);
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Like the original: one colour, dimmed to 0.4 until the form is ready */
    opacity: 0.4;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.btn.is-active {
    opacity: 1;
}

.btn.is-active:hover {
    background: var(--brand-blue-hover);
}

/* On submit the original dims the button back to 0.4 and shows a spinner */
.btn.is-loading {
    opacity: 0.4;
    cursor: default;
}

.btn__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn__spinner {
    display: inline-block;
}

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

/* Autofill hook: triggers the JS "animationstart" listener so the
   Login button enables even when the browser fills the fields. */
@keyframes onAutoFill {
    from {
        opacity: 1;
    }
    to {
        opacity: 1;
    }
}

input:-webkit-autofill {
    animation-name: onAutoFill;
    animation-duration: 0.01s;
}

/* --- Verify (2FA code) page --- */
.card__inner--center {
    text-align: center;
}

.lead {
    display: inline-block;
    text-align: left;
    font-size: 15px;
    font-weight: 400;
    line-height: 22.5px;
    color: #6b7399;
    margin: 0 0 22px;
}

.lead strong {
    font-weight: 600;
    color: #6b7399;
}

.resend {
    font-size: 15px;
    color: var(--ink);
    margin: 0 0 26px;
}

.help {
    font-size: 16px;
    color: #000000;
    margin: 30px 0 0;
}

.link-plain {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 400;
}

.link-plain:hover {
    text-decoration: underline;
}

.dot {
    color: #b9c2cc;
    margin: 0 4px;
}

.otp-form {
    margin: 0;
}

.otp {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.otp__box {
    width: 56px;
    height: 64px;
    border: none;
    border-radius: 6px;
    background: #f1f4f8;
    font-family: "Montserrat", sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
    text-align: center;
    caret-color: var(--brand-blue);
    box-shadow: inset 0 -3px 0 -1px #d9dee4;
    transition: box-shadow 0.15s ease, background 0.15s ease;
}

.otp__box:focus {
    outline: none;
    background: #eef3f8;
    box-shadow: inset 0 -3px 0 -1px var(--brand-blue);
}

.otp__box.is-filled {
    box-shadow: inset 0 -3px 0 -1px var(--brand-blue);
}

.chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

@media (max-width: 640px) {
    .card__inner {
        padding: 40px 28px 44px;
    }

    .otp {
        gap: 8px;
    }

    .otp__box {
        width: 44px;
        height: 54px;
        font-size: 20px;
    }

    .lang {
        top: 16px;
        right: 16px;
    }

    .topbar {
        padding-top: 32px;
    }

    .card {
        margin-top: 48px;
    }
}
