:root {
    --kapdio-blue: #0799ed;
    --kapdio-blue-dark: #057fc7;
    --kapdio-blue-soft: #e9f6ff;
    --auth-ink: #101828;
    --auth-muted: #667085;
    --auth-line: #dbe4ed;
    --auth-danger: #b42318;
    --auth-success: #067647;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #f7f8fa;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--auth-ink);
    background: #f7f8fa;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.is-hidden {
    display: none !important;
}

.auth-page {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: center;
}

.auth-shell {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 470px;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    padding: max(24px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom));
    background: #f7f8fa;
}

.auth-brand {
    display: flex;
    min-height: 96px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 0 0 6px;
}

.auth-brand-button {
    width: min(240px, 74vw);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform: translateY(-14px);
}

.auth-brand-button img {
    display: block;
    width: 100%;
    height: auto;
}

.auth-panel {
    width: 100%;
    min-width: 0;
    padding: 26px 20px 22px;
    border: 1px solid rgba(7, 153, 237, 0.1);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(20, 60, 90, 0.13);
}

.auth-form {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
}

.auth-heading {
    margin-bottom: 24px;
    text-align: center;
}

.auth-heading h1 {
    margin: 0;
    color: #0c1b33;
    font-size: 1.75rem;
    font-weight: 850;
    line-height: 1.18;
}

.auth-heading p {
    max-width: 350px;
    margin: 7px auto 0;
    color: var(--auth-muted);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.45;
}

.auth-heading p strong {
    color: #344054;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.auth-heading-with-icon {
    margin-bottom: 26px;
}

.auth-state-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    place-items: center;
    border: 1px solid #b9e4ff;
    border-radius: 50%;
    color: var(--kapdio-blue-dark);
    background: var(--kapdio-blue-soft);
    font-size: 1.7rem;
}

.field-group {
    display: flex;
    width: 100%;
    min-width: 0;
    margin-bottom: 17px;
    flex-direction: column;
}

.field-label {
    margin-bottom: 7px;
    color: #344054;
    font-size: 0.98rem;
    font-weight: 750;
    line-height: 1.25;
}

.field-control {
    display: grid;
    min-height: 54px;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-control:focus-within {
    border-color: var(--kapdio-blue);
    box-shadow: 0 0 0 3px rgba(7, 153, 237, 0.13);
}

.field-control > i {
    display: grid;
    place-items: center;
    border-right: 1px solid #d8e4ec;
    color: var(--kapdio-blue-dark);
    background: #f1f9ff;
    font-size: 1.12rem;
}

.field-control input {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    color: var(--auth-ink);
    background: transparent;
    font-size: 1rem;
    font-weight: 550;
}

.field-control input::placeholder {
    color: #98a2b3;
    opacity: 1;
    font-weight: 500;
}

.field-control:has(.password-toggle) {
    grid-template-columns: 46px minmax(0, 1fr) 48px;
}

.password-toggle {
    display: grid;
    min-width: 48px;
    min-height: 52px;
    padding: 0;
    place-items: center;
    border: 0;
    color: #667085;
    background: #fff;
    cursor: pointer;
    font-size: 1.08rem;
}

.password-toggle:focus-visible,
.text-link:focus-visible,
.back-link:focus-visible,
.auth-brand-button:focus-visible {
    outline: 3px solid rgba(7, 153, 237, 0.3);
    outline-offset: 2px;
}

.field-help {
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: 0.84rem;
    font-weight: 550;
    line-height: 1.3;
}

.field-control-code {
    display: block;
}

.field-control-code input {
    min-height: 58px;
    padding-left: 24px;
    text-align: center;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.48rem;
}

.auth-link-row {
    display: flex;
    margin-top: -6px;
    margin-bottom: 20px;
}

.auth-link-row-end {
    justify-content: flex-end;
}

.text-link,
.back-link {
    padding: 0;
    border: 0;
    color: #007dca;
    background: transparent;
    cursor: pointer;
    font-weight: 750;
}

.text-link {
    font-size: 0.95rem;
}

.auth-link-row .text-link {
    font-weight: 650;
}

.primary-button {
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--kapdio-blue);
    box-shadow: 0 7px 16px rgba(7, 153, 237, 0.23);
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
    background: var(--kapdio-blue-dark);
    box-shadow: 0 8px 18px rgba(5, 127, 199, 0.27);
}

.primary-button:active {
    transform: translateY(1px);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.button-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 700ms linear infinite;
}

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

.auth-switch {
    margin: 21px 0 0;
    color: var(--auth-muted);
    text-align: center;
    font-size: 0.96rem;
    font-weight: 550;
    line-height: 1.5;
}

.auth-switch .text-link {
    margin-left: 3px;
}

.back-link {
    display: flex;
    min-height: 46px;
    margin: 16px auto -4px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.94rem;
}

.auth-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 0.94rem;
    font-weight: 650;
    line-height: 1.4;
}

.auth-alert-error {
    border-color: #fecdca;
    color: var(--auth-danger);
    background: #fef3f2;
}

.auth-alert-success {
    border-color: #abefc6;
    color: var(--auth-success);
    background: #ecfdf3;
}

.auth-success {
    padding: 18px 0 8px;
    text-align: center;
}

.success-mark {
    display: grid;
    width: 78px;
    height: 78px;
    margin: 0 auto 22px;
    place-items: center;
    border: 7px solid #d1fadf;
    border-radius: 50%;
    color: #fff;
    background: #12b76a;
    font-size: 2rem;
}

.auth-footer {
    display: flex;
    width: 100%;
    min-height: 42px;
    margin: auto 0 0;
    padding: 9px 14px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #b9e4ff;
    border-radius: 8px;
    color: #057fc7;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 3px 10px rgba(5, 127, 199, 0.08);
    font-family: "Avenir Next", "Trebuchet MS", Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}

.auth-footer > i {
    font-size: 1rem;
}

.auth-footer-dot {
    width: 3px;
    height: 3px;
    flex: 0 0 3px;
    border-radius: 50%;
    background: #0799ed;
}

@media (max-width: 380px) {
    .auth-shell {
        padding-right: 12px;
        padding-left: 12px;
    }

    .auth-brand {
        min-height: 86px;
        padding-bottom: 2px;
    }

    .auth-brand-button {
        width: min(225px, 72vw);
    }

    .auth-panel {
        padding: 22px 15px 20px;
    }

    .auth-footer {
        gap: 6px;
        padding-inline: 9px;
        font-size: 0.68rem;
    }

    .auth-heading h1 {
        font-size: 1.55rem;
    }
}

body.app-keyboard-open .auth-shell,
body.native-keyboard-open .auth-shell {
    min-height: 100%;
    padding-top: 4px;
    padding-bottom: 10px;
}

body.app-keyboard-open .auth-brand,
body.native-keyboard-open .auth-brand {
    min-height: 0;
    padding: 0 0 5px;
}

body.app-keyboard-open .auth-brand-button,
body.native-keyboard-open .auth-brand-button {
    width: min(185px, 55vw);
}

body.app-keyboard-open .auth-panel,
body.native-keyboard-open .auth-panel {
    padding-top: 18px;
    padding-bottom: 18px;
}

body.app-keyboard-open .auth-heading,
body.native-keyboard-open .auth-heading {
    margin-bottom: 16px;
}

body.app-keyboard-open .auth-form,
body.native-keyboard-open .auth-form {
    padding-bottom: 28px;
}

body.app-keyboard-open .field-group,
body.native-keyboard-open .field-group {
    scroll-margin-top: 18px;
    scroll-margin-bottom: 32px;
}

body.app-keyboard-open .auth-footer,
body.native-keyboard-open .auth-footer {
    display: none;
}

@media (min-width: 700px) {
    body {
        padding: 28px;
    }

    .auth-page {
        align-items: center;
    }

    .auth-shell {
        min-height: min(820px, calc(100dvh - 56px));
        padding: 30px 28px 20px;
        border: 1px solid rgba(7, 153, 237, 0.12);
        border-radius: 8px;
        box-shadow: 0 22px 60px rgba(29, 75, 105, 0.15);
    }

    .auth-panel {
        padding: 30px 28px 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
