@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap");

:root {
    --page-bg: #f4f7fb;
    --panel-bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.92);
    --text-primary: #122033;
    --text-secondary: #64748b;
    --text-soft: #8190a5;
    --border: #dce4ee;
    --border-strong: #bcc9d9;
    --accent: #1e85fb;
    --accent-hover: #0873e8;
    --accent-soft: rgba(30, 133, 251, 0.10);
    --danger: #c43d3d;
    --success: #168653;
    --warning: #a96000;
    --shadow: 0 24px 80px rgba(17, 40, 72, 0.11);
    --focus: 0 0 0 4px rgba(30, 133, 251, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    font-family: "Manrope", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--page-bg);
    color: var(--text-primary);
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(520px, 1.08fr) minmax(480px, 0.92fr);
}

/* Visual side */

.auth-visual {
    position: relative;
    min-height: 100vh;
    padding: clamp(38px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    isolation: isolate;
    color: white;

    background-image: url("/assets/landing/telene_auth_hero.webp");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 40% center;
}

.auth-visual-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(2, 19, 47, 0.76) 0%, rgba(3, 31, 72, 0.48) 48%, rgba(3, 31, 72, 0.12) 100%),
        linear-gradient(180deg, rgba(0, 23, 55, 0.10), rgba(0, 19, 46, 0.42));
}

.visual-brand,
.mobile-brand a {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    width: fit-content;
    color: inherit;
    text-decoration: none;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.telene-mark {
    width: 35px;
    height: 35px;
    fill: none;
    stroke: currentColor;
    stroke-width: 4.2;
    stroke-linecap: round;
}

.visual-copy {
    width: min(610px, 88%);
    margin: auto 0;
    padding: 80px 0;
}

.visual-eyebrow,
.auth-product-label {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.visual-eyebrow {
    color: rgba(255, 255, 255, 0.68);
}

.visual-copy h1 {
    max-width: 590px;
    margin: 0;
    font-size: clamp(42px, 5.1vw, 72px);
    line-height: 1.03;
    font-weight: 500;
    letter-spacing: -0.055em;
}

.visual-copy>p:not(.visual-eyebrow) {
    max-width: 520px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: clamp(16px, 1.35vw, 19px);
    line-height: 1.7;
}

.product-context {
    width: fit-content;
    margin-top: 30px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(4, 34, 75, 0.30);
    color: rgba(255, 255, 255, 0.90);
    font-size: 13px;
    backdrop-filter: blur(12px);
}

.product-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #72b9ff;
    box-shadow: 0 0 16px rgba(114, 185, 255, 0.85);
}

.visual-footnote {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

/* Form side */

.auth-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 48px clamp(34px, 5vw, 78px);
    background:
        radial-gradient(circle at 90% 10%, rgba(30, 133, 251, 0.07), transparent 24rem),
        var(--panel-bg);
}

.auth-content {
    width: 100%;
    max-width: 445px;
}

.mobile-brand {
    display: none;
}

.auth-view {
    width: 100%;
}

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

.auth-product-label {
    color: var(--accent);
}

.auth-heading h2 {
    margin: 0;
    font-size: clamp(30px, 3vw, 38px);
    line-height: 1.15;
    font-weight: 650;
    letter-spacing: -0.045em;
}

.auth-heading>p:last-child {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.65;
}

.provider-stack {
    display: grid;
    gap: 10px;
}

.provider-btn {
    width: 100%;
    min-height: 49px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 24px 1fr 24px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease;
}

.provider-btn svg {
    width: 20px;
    height: 20px;
}

.provider-btn span {
    grid-column: 2;
}

.provider-btn:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: #fbfdff;
    box-shadow: 0 8px 22px rgba(30, 54, 82, 0.08);
}

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

.auth-divider {
    position: relative;
    margin: 24px 0;
    text-align: center;
}

.auth-divider::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    border-top: 1px solid var(--border);
}

.auth-divider span {
    position: relative;
    padding: 0 12px;
    background: var(--panel-bg);
    color: var(--text-soft);
    font-size: 12px;
}

.auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 24px;
    padding: 5px;
    border-radius: 13px;
    background: #edf2f7;
}

.auth-switch button {
    min-height: 39px;
    padding: 8px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.auth-switch button.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 5px 15px rgba(22, 43, 70, 0.08);
}

.auth-form {
    display: grid;
    gap: 17px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: #26384f;
    font-size: 13px;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.auth-form input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text-primary);
    font-size: 14px;
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease;
}

.auth-form input::placeholder {
    color: #9aa8b9;
}

.auth-form input:hover {
    border-color: var(--border-strong);
}

.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 66px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    min-width: 47px;
    min-height: 34px;
    padding: 0 8px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.password-toggle:hover {
    background: #eef4fa;
    color: var(--text-primary);
}

.text-btn {
    padding: 2px;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

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

.field-help,
.legal-copy,
.auth-help {
    margin: 0;
    color: var(--text-secondary);
    font-size: 11.5px;
    line-height: 1.55;
}

.legal-copy {
    text-align: center;
}

.legal-copy a,
.auth-help a,
.auth-footer a {
    color: inherit;
    text-underline-offset: 3px;
}

.primary-btn {
    position: relative;
    width: 100%;
    min-height: 50px;
    margin-top: 1px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(30, 133, 251, 0.20);
    transition:
        transform 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease;
}

.primary-btn:hover {
    transform: translateY(-1px);
    background: var(--accent-hover);
    box-shadow: 0 13px 30px rgba(30, 133, 251, 0.26);
}

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

.primary-btn:disabled,
.provider-btn:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}

.button-spinner {
    display: none;
    position: absolute;
    top: 50%;
    right: 17px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: white;
    border-radius: 50%;
    animation: button-spin 700ms linear infinite;
}

.is-loading .button-spinner {
    display: block;
}

.auth-status {
    min-height: 22px;
    margin: 15px 0 0;
    padding: 0;
    font-size: 12.5px;
    line-height: 1.55;
}

.auth-status:empty {
    display: none;
}

.auth-status-info {
    color: var(--text-secondary);
}

.auth-status-success {
    color: var(--success);
}

.auth-status-warning {
    color: var(--warning);
}

.auth-status-error {
    color: var(--danger);
}

/* TOTP challenge */

.back-btn {
    margin: 0 0 28px;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.back-btn:hover {
    color: var(--text-primary);
}

.security-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 21px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--accent-soft);
    color: var(--accent);
}

.security-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.totp-input {
    height: 58px !important;
    text-align: center;
    font-size: 24px !important;
    font-weight: 650;
    letter-spacing: 0.34em;
    font-variant-numeric: tabular-nums;
}

.auth-help {
    margin-top: 21px;
    text-align: center;
}

.auth-footer {
    margin-top: 33px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-soft);
    font-size: 11.5px;
}

.hidden {
    display: none !important;
}

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

@media (max-width: 1050px) {
    .auth-shell {
        grid-template-columns: minmax(400px, 0.9fr) minmax(440px, 1.1fr);
    }

    .visual-copy h1 {
        font-size: clamp(40px, 5vw, 58px);
    }
}

@media (max-width: 860px) {
    .auth-shell {
        display: block;
    }

    .auth-visual {
        min-height: 150px;
        height: 150px;
        padding: 24px;
        justify-content: flex-start;
        background-position: 65% 52%;
    }

    .auth-visual-shade {
        background: rgba(2, 25, 59, 0.52);
    }

    .visual-brand,
    .visual-copy,
    .visual-footnote {
        display: none;
    }

    .auth-panel {
        min-height: calc(100vh - 150px);
        padding: 32px 24px 42px;
        place-items: start center;
    }

    .auth-content {
        max-width: 470px;
    }

    .mobile-brand {
        margin: -88px 0 62px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: white;
    }

    .mobile-brand a {
        color: white;
        font-size: 21px;
    }

    .mobile-brand p {
        margin: 0;
        max-width: 190px;
        color: rgba(255, 255, 255, 0.78);
        font-size: 11px;
        text-align: right;
    }
}

@media (max-width: 520px) {
    .auth-visual {
        min-height: 118px;
        height: 118px;
        padding: 20px;
    }

    .auth-panel {
        min-height: calc(100vh - 118px);
        padding: 25px 19px 34px;
    }

    .mobile-brand {
        margin: -69px 0 48px;
    }

    .mobile-brand p {
        display: none;
    }

    .auth-heading h2 {
        font-size: 30px;
    }

    .auth-footer {
        margin-top: 28px;
    }
}

@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;
    }
}