@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:wght@700;800&display=swap');

:root {
    --bg: #eef3f9;
    --surface: #ffffff;
    --surface-soft: #f7faff;
    --line: #d7dfeb;
    --line-strong: #c3cedd;
    --text: #111827;
    --muted: #6b778a;
    --primary: #1f5eff;
    --primary-dark: #1749c8;
    --primary-soft: rgba(31, 94, 255, 0.12);
    --brand-ink: #061b3d;
    --brand-blue: #083f8f;
    --brand-blue-deep: #05265f;
    --danger: #d92f42;
    --success: #168348;
    --shadow-lg: 0 26px 70px rgba(19, 35, 64, 0.16);
    --shadow-md: 0 16px 34px rgba(19, 35, 64, 0.10);
    --radius-card: 8px;
    --radius-control: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background:
        linear-gradient(125deg, #f9fbff 0%, #eef4fb 48%, #e8f0fa 100%);
    display: grid;
    place-items: center;
    padding: 24px;
}

button,
input {
    font: inherit;
}

.auth-layout {
    width: min(1180px, 100%);
    min-height: min(760px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr);
    overflow: hidden;
    border: 1px solid rgba(116, 132, 156, 0.18);
    border-radius: var(--radius-card);
    background: #ffffff;
    box-shadow: var(--shadow-lg);
}

.brand-panel {
    position: relative;
    min-height: 680px;
    padding: 54px;
    color: #eef6ff;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(ellipse at 76% 20%, rgba(74, 144, 255, 0.28) 0%, rgba(74, 144, 255, 0) 42%),
        linear-gradient(145deg, var(--brand-blue-deep) 0%, var(--brand-blue) 58%, #0b55b8 100%);
    background-size: 38px 38px, 38px 38px, auto, auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 42px;
    isolation: isolate;
    overflow: hidden;
}

.brand-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.10), transparent 26%),
        repeating-linear-gradient(112deg, transparent 0 22px, rgba(255, 255, 255, 0.025) 22px 23px);
    mix-blend-mode: screen;
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.logo-icon {
    position: relative;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 14px 34px rgba(0, 0, 0, 0.18);
}

.logo-icon::before,
.logo-icon::after {
    content: "";
    position: absolute;
    border-radius: 999px;
}

.logo-icon::before {
    width: 16px;
    height: 16px;
    left: 8px;
    top: 8px;
    border: 2px solid #ffffff;
    border-right-color: rgba(126, 211, 255, 0.48);
}

.logo-icon::after {
    width: 6px;
    height: 6px;
    right: 7px;
    bottom: 7px;
    background: #7ed3ff;
    box-shadow: -12px -12px 0 rgba(255, 255, 255, 0.72);
}

.brand-title {
    margin: 88px 0 18px;
    max-width: 640px;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 52px;
    line-height: 1.02;
    letter-spacing: 0;
    color: #ffffff;
}

.brand-copy {
    margin: 0;
    max-width: 56ch;
    color: rgba(232, 242, 255, 0.84);
    font-size: 15px;
    line-height: 1.8;
}

.feature-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    max-width: 610px;
}

.feature-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 4px 0;
    color: rgba(242, 248, 255, 0.94);
}

.feature-item p {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.feature-icon {
    position: relative;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(204, 230, 255, 0.42);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.feature-icon::before,
.feature-icon::after {
    content: "";
    position: absolute;
}

.icon-access::before {
    width: 14px;
    height: 14px;
    left: 9px;
    top: 6px;
    border: 1.5px solid #dcecff;
    border-radius: 50%;
}

.icon-access::after {
    width: 18px;
    height: 8px;
    left: 7px;
    bottom: 6px;
    border: 1.5px solid #7ed3ff;
    border-radius: 12px 12px 4px 4px;
}

.icon-sentiment::before {
    inset: 8px;
    border: 1.5px solid #dcecff;
    border-radius: 50%;
}

.icon-sentiment::after {
    width: 12px;
    height: 5px;
    left: 10px;
    top: 17px;
    border-bottom: 1.5px solid #7ed3ff;
    border-radius: 0 0 999px 999px;
    box-shadow: -4px -5px 0 -2px #dcecff, 4px -5px 0 -2px #dcecff;
}

.icon-progress::before {
    width: 18px;
    height: 18px;
    left: 7px;
    top: 7px;
    border: 1.5px solid rgba(220, 236, 255, 0.5);
    border-top-color: #7ed3ff;
    border-right-color: #dcecff;
    border-radius: 50%;
    transform: rotate(35deg);
}

.icon-progress::after {
    width: 10px;
    height: 2px;
    left: 11px;
    bottom: 9px;
    background: #dcecff;
    box-shadow: 0 -5px 0 #7ed3ff;
}

.icon-security::before {
    width: 15px;
    height: 12px;
    left: 9px;
    bottom: 7px;
    border: 1.5px solid #dcecff;
    border-radius: 4px;
}

.icon-security::after {
    width: 10px;
    height: 9px;
    left: 11px;
    top: 8px;
    border: 1.5px solid #7ed3ff;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}

.brand-ambient {
    position: absolute;
    z-index: 1;
    border: 1px solid rgba(215, 235, 255, 0.20);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.065);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 20px 60px rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.brand-ambient-curve {
    display: none;
}

.brand-ambient-curve span {
    position: absolute;
    left: 20px;
    right: 20px;
    height: 26px;
    border-bottom: 2px solid rgba(126, 211, 255, 0.5);
    border-radius: 0 0 50% 50%;
}

.brand-ambient-curve span:nth-child(1) {
    top: 28px;
    transform: rotate(-6deg);
}

.brand-ambient-curve span:nth-child(2) {
    top: 48px;
    border-bottom-color: rgba(255, 255, 255, 0.42);
    transform: rotate(5deg);
}

.brand-ambient-curve span:nth-child(3) {
    top: 66px;
    transform: rotate(-2deg);
}

.brand-ambient-gauge {
    width: 154px;
    height: 154px;
    right: 76px;
    bottom: 148px;
    opacity: 0.34;
    border-radius: 50%;
}

.brand-ambient-gauge span {
    position: absolute;
    inset: 22px;
    border: 10px solid rgba(255, 255, 255, 0.14);
    border-top-color: rgba(126, 211, 255, 0.72);
    border-right-color: rgba(126, 211, 255, 0.52);
    border-radius: 50%;
    transform: rotate(28deg);
}

.auth-panel {
    position: relative;
    display: grid;
    place-items: center;
    padding: 48px;
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.88), rgba(238, 244, 252, 0.94)),
        linear-gradient(180deg, #f7faff 0%, #edf3fb 100%);
}

.brand-panel,
.brand-content,
.feature-grid {
    cursor: default;
    user-select: none;
}

.auth-panel,
.auth-card {
    cursor: default;
}

.auth-panel input,
.auth-panel textarea {
    cursor: text;
}

.auth-card {
    width: min(430px, 100%);
    min-height: 620px;
    padding: 38px;
    border: 1px solid rgba(140, 154, 178, 0.18);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 54px rgba(35, 53, 84, 0.11);
}

.view-stack {
    position: relative;
    min-height: 544px;
}

.auth-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(18px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.auth-view.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.view-top {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn,
.step-chip {
    min-height: 30px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
}

.back-btn {
    min-width: 56px;
    padding: 0 12px;
    border: 0;
    cursor: pointer;
}

.step-chip {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
}

.heading {
    margin: 10px 0 0;
    color: #111827;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: 0;
    font-weight: 800;
}

.description {
    margin: 0 0 10px;
    max-width: 38ch;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.field-stack {
    display: grid;
    gap: 15px;
}

.name-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #2f3a4c;
    font-size: 12px;
    font-weight: 700;
}

.input {
    width: 100%;
    height: 50px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    padding: 0 14px;
    background: #ffffff;
    color: #142033;
    font-size: 14px;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(19, 35, 64, 0.035);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.input:focus {
    border-color: rgba(31, 94, 255, 0.72);
    box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12), inset 0 1px 2px rgba(19, 35, 64, 0.035);
}

.input::placeholder {
    color: #9aa6b8;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

.password-wrap {
    position: relative;
}

.password-wrap .input {
    padding-right: 52px;
}

.eye-btn {
    position: absolute;
    top: 50%;
    right: 9px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.16s ease, color 0.16s ease;
}

.eye-btn::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 12px;
    left: 8px;
    top: 11px;
    border: 1.6px solid currentColor;
    border-radius: 70% 30% 70% 30% / 60% 40% 60% 40%;
    transform: rotate(45deg);
}

.eye-btn::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    left: 14px;
    top: 14px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 2px #ffffff;
}

.eye-btn.is-visible {
    color: var(--primary-dark);
}

.eye-btn.is-visible::before {
    box-shadow: 10px -10px 0 -9px currentColor;
}

.eye-btn:hover,
.eye-btn:focus-visible {
    background: rgba(31, 94, 255, 0.08);
    color: var(--primary-dark);
    outline: none;
}

.inline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.text-link,
.policy-link,
.inline-policy-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--primary-dark);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover,
.policy-link:hover,
.inline-policy-link:hover {
    color: #0f3ba5;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.submit-btn {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: var(--radius-control);
    background: linear-gradient(180deg, #2e72ff 0%, var(--primary) 52%, #174ad4 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 16px 30px rgba(31, 94, 255, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(31, 94, 255, 0.34);
    filter: saturate(1.04);
}

.submit-btn:disabled {
    opacity: 0.82;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.helper-note {
    margin: 2px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.card-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 18px;
    border-top: 1px solid #edf1f6;
}

.card-footer-links span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #bdc6d3;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #596579;
    font-size: 12px;
    line-height: 1.55;
}

.checkbox-row input {
    margin-top: 2px;
    accent-color: var(--primary);
}

.checkbox-copy {
    flex: 1;
}

.password-strength {
    display: grid;
    gap: 6px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.password-strength::before {
    content: "";
    display: block;
    height: 6px;
    border-radius: 999px;
    background: #dbe3f2;
}

.password-strength span {
    display: block;
    width: 0;
    height: 6px;
    margin-top: -12px;
    border-radius: 999px;
    background: var(--danger);
    transition: width 180ms ease, background-color 180ms ease;
}

.password-strength[data-level="2"] span {
    background: #c77800;
}

.password-strength[data-level="3"] span,
.password-strength[data-level="4"] span {
    background: var(--success);
}

.progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
}

.progress-step {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #d6deea;
    flex: 0 0 auto;
}

.progress-step.active {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
}

.progress-line {
    height: 2px;
    flex: 1;
    background: #d6deea;
    border-radius: 999px;
}

.progress-line.active {
    background: linear-gradient(90deg, var(--primary), #92c9ff);
}

.otp-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.otp-box {
    width: 100%;
    height: 50px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    text-align: center;
    color: #1d2738;
    background: #ffffff;
    font-size: 18px;
    font-weight: 700;
    outline: none;
}

.otp-box:focus {
    border-color: rgba(31, 94, 255, 0.72);
    box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
}

.loading-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

.error-text {
    min-height: 16px;
    margin-top: -2px;
    color: var(--danger);
    font-size: 12px;
}

.status-banner {
    display: none;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-size: 13px;
    line-height: 1.4;
}

.status-banner.show {
    display: block;
}

.status-banner.error {
    background: #fff0f2;
    border-color: #ffc9d0;
    color: #ab2230;
}

.status-banner.success {
    background: #eefbf3;
    border-color: #bde8cc;
    color: #126b39;
}

.agreement-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(11, 22, 42, 0.54);
}

.agreement-modal.active {
    display: grid;
}

.agreement-dialog {
    width: min(560px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    overflow: auto;
    padding: 22px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-card);
    background: #ffffff;
    box-shadow: var(--shadow-lg);
}

.agreement-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.agreement-header h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.agreement-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.agreement-body {
    display: grid;
    gap: 14px;
    color: #42516a;
    font-size: 13px;
    line-height: 1.65;
}

.agreement-body h3 {
    margin: 0 0 6px;
    color: #152238;
    font-size: 14px;
}

.agreement-body p {
    margin: 0;
}

.agreement-body ul {
    margin: 0;
    padding-left: 18px;
}

.agreement-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.agreement-actions .submit-btn {
    width: auto;
    min-width: 120px;
    height: 42px;
    padding: 0 18px;
}

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

@media (max-width: 1040px) {
    body {
        padding: 16px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .brand-panel {
        min-height: 520px;
        padding: 42px;
    }

    .brand-title {
        margin-top: 72px;
        font-size: 44px;
    }

    .auth-panel {
        padding: 34px;
    }
}

@media (max-width: 640px) {
    html {
        min-height: 100%;
        scroll-behavior: smooth;
    }

    body {
        min-height: 100dvh;
        display: block;
        padding: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #f5f8fc;
    }

    .auth-layout {
        width: 100%;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
        background: #f5f8fc;
    }

    .brand-panel {
        min-height: 0;
        padding: 22px 20px 18px;
        gap: 14px;
        background:
            radial-gradient(circle at 80% 10%, rgba(126, 211, 255, 0.20), transparent 30%),
            linear-gradient(145deg, #05265f 0%, #083f8f 100%);
    }

    .brand-mark {
        font-size: 14px;
    }

    .logo-icon {
        width: 30px;
        height: 30px;
    }

    .brand-title {
        margin: 18px 0 8px;
        font-family: "Inter", "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: clamp(22px, 7vw, 30px);
        line-height: 1.15;
    }

    .brand-copy {
        font-size: 13px;
        line-height: 1.55;
    }

    .feature-grid {
        display: none;
    }

    .brand-ambient-curve {
        display: none;
    }

    .brand-ambient-gauge {
        display: none;
    }

    .auth-panel {
        display: block;
        padding: 14px;
        background: #f5f8fc;
    }

    .auth-card {
        width: 100%;
        min-height: 0;
        padding: 22px 18px;
        border-radius: 16px;
        box-shadow: 0 16px 36px rgba(35, 53, 84, 0.10);
    }

    .view-stack {
        min-height: 0;
    }

    .auth-view {
        position: static;
        inset: auto;
        display: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

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

    .heading {
        font-size: 28px;
    }

    .description {
        font-size: 13px;
        line-height: 1.55;
    }

    .field-stack {
        gap: 14px;
    }

    .name-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .field label {
        margin-bottom: 8px;
        font-size: 13px;
    }

    .input,
    .otp-box {
        height: 52px;
        border-radius: 14px;
    }

    .checkbox-row {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 2px 0;
    }

    .checkbox-row input {
        width: 20px;
        height: 20px;
        margin: 2px 0 0;
    }

    .checkbox-copy {
        display: inline;
        line-height: 1.55;
    }

    .inline-policy-link {
        width: auto;
        min-height: 0;
        display: inline;
        vertical-align: baseline;
    }

    .otp-row {
        gap: 6px;
    }

    .submit-btn {
        height: 54px;
        border-radius: 14px;
        font-size: 15px;
    }
}

/* Login-wide non-editable UI guard: only form controls should show a text caret. */
html,
body,
.auth-layout,
.brand-panel,
.auth-panel,
.auth-card {
    caret-color: transparent;
}

body :where(
    h1,
    h2,
    h3,
    p,
    span,
    small,
    strong,
    label,
    div,
    section,
    article,
    button,
    a
) {
    caret-color: transparent !important;
    cursor: default;
    user-select: none;
}

body :where(input, textarea, select, [contenteditable="true"], [role="textbox"]) {
    caret-color: auto !important;
    cursor: text;
    user-select: text;
}

body :where(button, a, .text-link, .policy-link, .inline-policy-link, .eye-btn, .back-btn, .submit-btn) {
    cursor: pointer;
}

/* Final login accessibility and responsive stability layer. */
body {
    overflow-x: hidden;
}

button,
input,
select,
textarea,
.submit-btn,
.text-link,
.policy-link,
.inline-policy-link,
.back-btn,
.eye-btn {
    min-height: 44px;
}

input,
select,
textarea {
    max-width: 100%;
    font-size: 16px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(31, 94, 255, 0.5);
    outline-offset: 3px;
}

.agreement-modal {
    padding: clamp(12px, 3vw, 28px);
}

.agreement-dialog {
    width: min(720px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow: auto;
    overscroll-behavior: contain;
}

.status-banner,
.description,
.helper-note {
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .auth-card {
        width: 100%;
    }

    .inline-row,
    .card-footer-links {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .submit-btn,
    .back-btn,
    .text-link,
    .policy-link {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .auth-panel {
        padding: 10px;
    }

    .auth-card {
        padding: 20px 14px;
    }

    .brand-panel {
        padding-inline: 16px;
    }
}

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

/* Final login layout fix: keep policy links inside the active card content. */
body {
    background: #f4f7fb;
}

.auth-layout {
    background: #f4f7fb;
}

.brand-panel {
    background:
        linear-gradient(90deg, rgba(6, 31, 62, 0.88) 0%, rgba(8, 50, 95, 0.78) 46%, rgba(8, 50, 95, 0.48) 100%),
        url("../images/login-immersion-bg.png") center / cover no-repeat !important;
    background-color: #0f4c81 !important;
}

.brand-panel::before {
    opacity: 0.16;
}

.brand-panel::after,
.brand-ambient {
    opacity: 0.28;
}

.brand-title {
    color: #ffffff;
    letter-spacing: 0;
}

.brand-copy,
.feature-item p,
.brand-mark {
    color: rgba(255, 255, 255, 0.9) !important;
}

.feature-icon {
    border-color: rgba(255, 255, 255, 0.28) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.auth-panel {
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.88), rgba(238, 244, 252, 0.94)),
        #f4f7fb !important;
}

.auth-card {
    min-height: 0;
    border: 1px solid #e8eef7;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(16, 24, 40, 0.09);
}

.view-stack {
    min-height: 0;
}

.auth-view.active {
    position: relative;
}

.card-footer-links {
    margin-top: 8px;
    padding-top: 12px;
}

.heading {
    color: #172033;
    font-size: 30px;
    letter-spacing: 0;
}

.description,
.helper-note {
    color: #647084;
}

.field label {
    color: #172033;
}

.input,
.otp-box {
    border-color: #d9e2ef;
    border-radius: 8px;
    color: #172033;
}

.input:focus,
.otp-box:focus {
    border-color: #7aa7d6;
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.14);
}

.submit-btn {
    border-radius: 8px;
    background: #0f4c81;
    box-shadow: none;
}

.submit-btn:hover {
    background: #08345d;
    box-shadow: none;
}

.text-link,
.policy-link,
.inline-policy-link {
    color: #0f4c81;
}

.card-footer-links {
    border-top-color: #e8eef7;
}

.step-chip,
.back-btn {
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
}

.password-strength::before {
    background: #e7eef7;
}

@media (max-width: 760px) {
    .brand-title {
        max-width: 100%;
        font-size: clamp(24px, 7vw, 28px);
        overflow-wrap: anywhere;
    }

    .auth-card {
        min-width: 0;
        max-width: 100%;
        border-radius: 8px;
        box-shadow: none;
    }
}

@media (max-width: 640px) {
    html,
    body,
    .auth-layout,
    .brand-panel,
    .auth-panel,
    .auth-card,
    .view-stack,
    .auth-view {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    html,
    body {
        overflow-x: hidden;
    }

    .brand-title,
    .brand-copy,
    .description,
    .helper-note {
        overflow-wrap: anywhere;
        word-break: normal;
    }
}
