:root {
    --login-navy-950: #061528;
    --login-navy-900: #071c33;
    --login-navy-800: #0b2b49;
    --login-blue: #0a84ff;
    --login-blue-dark: #006ed6;
    --login-cyan: #5ad7ff;
    --login-surface: #ffffff;
    --login-canvas: #edf3f8;
    --login-text: #102033;
    --login-muted: #66768a;
    --login-border: #dbe4ed;
    --login-danger: #c53030;
    --login-danger-bg: #fff4f3;
    --login-shadow: 0 32px 80px rgba(17, 37, 59, 0.18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--login-canvas);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--login-text);
    background: linear-gradient(135deg, #f1f3f5 0%, #e7eaee 45%, #dfe3e8 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

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

.login-page {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    overflow: hidden;
    padding: 40px;
}

.login-page::before {
    position: fixed;
    inset: -28%;
    z-index: -3;
    background:
        radial-gradient(circle at 18% 25%, rgba(164, 177, 192, 0.42), transparent 24%),
        radial-gradient(circle at 78% 18%, rgba(108, 124, 143, 0.32), transparent 25%),
        radial-gradient(circle at 82% 78%, rgba(190, 197, 207, 0.34), transparent 23%),
        radial-gradient(circle at 25% 82%, rgba(126, 139, 154, 0.26), transparent 25%),
        radial-gradient(circle at 52% 50%, rgba(91, 119, 147, 0.22), transparent 30%);
    content: "";
    filter: blur(58px) saturate(72%);
    pointer-events: none;
    animation: aurora-drift 22s ease-in-out infinite alternate;
}

.login-page::after {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(90deg, rgba(39, 71, 103, 0.035) 1px, transparent 1px),
        linear-gradient(rgba(39, 71, 103, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    content: "";
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 92%);
    pointer-events: none;
}

.page-glow {
    position: fixed;
    z-index: -1;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(18px);
    mix-blend-mode: multiply;
    opacity: 0.52;
    pointer-events: none;
}

.page-glow--top {
    top: -280px;
    right: -130px;
    background: radial-gradient(circle, rgba(102, 119, 139, 0.32), rgba(102, 119, 139, 0));
    animation: glow-float-top 16s ease-in-out infinite alternate;
}

.page-glow--middle {
    top: 28%;
    left: -260px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(157, 169, 183, 0.34), rgba(157, 169, 183, 0));
    animation: glow-float-middle 20s ease-in-out infinite alternate;
}

.page-glow--bottom {
    bottom: -330px;
    left: -120px;
    background: radial-gradient(circle, rgba(110, 126, 145, 0.28), rgba(110, 126, 145, 0));
    animation: glow-float-bottom 18s ease-in-out infinite alternate;
}

.sacred-geometry-backdrop {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: -1;
    width: min(920px, 94vw);
    aspect-ratio: 1;
    color: #168de9;
    filter:
        blur(1.25px)
        drop-shadow(0 0 18px rgba(124, 144, 166, 0.24))
        drop-shadow(0 0 38px rgba(82, 99, 119, 0.16));
    opacity: 0.38;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(1.22);
}

.sacred-geometry-backdrop::before,
.sacred-geometry-backdrop::after {
    position: absolute;
    inset: 14%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(55, 191, 229, 0.12), transparent 66%);
    content: "";
}

.sacred-geometry-backdrop::after {
    inset: 28%;
    background: rgba(10, 132, 255, 0.08);
    filter: blur(70px);
}

.sacred-geometry {
    width: 100%;
    height: 100%;
    overflow: visible;
    animation: sacred-rotation 90s linear infinite;
}

.sacred-geometry__metatron {
    fill: none;
    stroke: url("#metatron-gradient");
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sacred-geometry__lines {
    stroke-width: 1.05;
}

.sacred-geometry__circles {
    stroke-width: 1.4;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.88fr) minmax(440px, 1.12fr);
    width: min(1080px, 100%);
    min-height: 650px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: var(--login-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.brand-panel {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 54px 52px 42px;
    color: #ffffff;
    background:
        radial-gradient(circle at 20% 95%, rgba(25, 171, 215, 0.32), transparent 36%),
        radial-gradient(circle at 90% 12%, rgba(10, 132, 255, 0.27), transparent 28%),
        linear-gradient(145deg, var(--login-navy-950), var(--login-navy-800));
}

.brand-panel::after {
    position: absolute;
    right: -100px;
    bottom: -130px;
    z-index: -1;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow:
        0 0 0 42px rgba(255, 255, 255, 0.025),
        0 0 0 84px rgba(255, 255, 255, 0.018);
    content: "";
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    width: fit-content;
}

.brand-mark {
    display: inline-grid;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: #ffffff;
    background: linear-gradient(145deg, var(--login-blue), #35c7e7);
    box-shadow: 0 12px 30px rgba(0, 110, 214, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-size: 24px;
    place-items: center;
}

.brand-name {
    color: #ffffff;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -0.045em;
}

.brand-name span {
    color: var(--login-cyan);
}

.brand-copy {
    display: flex;
    flex: 1;
    align-items: center;
    margin: 0;
    padding: 56px 0 72px;
}

.brand-message-group {
    display: grid;
    gap: 26px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--login-blue-dark);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.brand-message {
    max-width: 420px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 540;
    letter-spacing: -0.045em;
    line-height: 1.16;
}

.brand-message strong {
    color: var(--login-cyan);
    font-weight: 720;
}

.present-message {
    max-width: 390px;
    margin: 0;
    padding-left: 18px;
    border-left: 2px solid rgba(90, 215, 255, 0.62);
    color: rgba(226, 239, 249, 0.72);
    font-size: 0.9rem;
    font-weight: 470;
    line-height: 1.72;
    animation: phrase-reveal 600ms ease both;
}

.form-panel {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 60px 68px 34px;
    border-left: 1px solid rgba(255, 255, 255, 0.68);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(244, 250, 255, 0.38)),
        rgba(255, 255, 255, 0.22);
    box-shadow:
        inset 1px 0 0 rgba(255, 255, 255, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px) saturate(145%);
    -webkit-backdrop-filter: blur(30px) saturate(145%);
}

.form-panel::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 90% 8%, rgba(255, 255, 255, 0.82), transparent 31%),
        linear-gradient(120deg, rgba(255, 255, 255, 0.24), transparent 42%);
    content: "";
    pointer-events: none;
}

.form-panel__content {
    width: min(100%, 430px);
    margin: auto;
}

.form-header h1 {
    margin: 0;
    color: var(--login-text);
    font-size: clamp(2rem, 3.5vw, 2.65rem);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.form-header p {
    margin: 14px 0 0;
    color: var(--login-muted);
    font-size: 0.97rem;
    line-height: 1.65;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
    padding: 14px 15px;
    border: 1px solid #f2c9c5;
    border-radius: 14px;
    color: var(--login-danger);
    background: var(--login-danger-bg);
    font-size: 0.84rem;
    line-height: 1.4;
}

.login-alert__icon {
    display: grid;
    flex: 0 0 auto;
    width: 27px;
    height: 27px;
    border-radius: 9px;
    color: #ffffff;
    background: var(--login-danger);
    font-size: 0.76rem;
    place-items: center;
}

.login-alert div {
    display: grid;
    gap: 2px;
}

.login-form {
    display: grid;
    gap: 20px;
    margin-top: 32px;
}

.field-group {
    display: grid;
    gap: 9px;
}

.field-group label {
    margin: 0;
    color: #34465a;
    font-size: 0.81rem;
    font-weight: 700;
}

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

.field-label-row span {
    color: #95a1af;
    font-size: 0.7rem;
}

.field-control {
    display: flex;
    align-items: center;
    min-height: 56px;
    overflow: hidden;
    border: 1px solid rgba(203, 218, 231, 0.78);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 22px rgba(42, 74, 104, 0.04);
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.field-control:focus-within {
    border-color: var(--login-blue);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12), 0 12px 24px rgba(25, 68, 106, 0.07);
}

.field-control__icon {
    flex: 0 0 auto;
    width: 50px;
    color: #8290a0;
    font-size: 0.94rem;
    text-align: center;
    transition: color 160ms ease;
}

.field-control:focus-within .field-control__icon {
    color: var(--login-blue);
}

.field-control input {
    min-width: 0;
    flex: 1;
    align-self: stretch;
    border: 0;
    outline: 0;
    color: var(--login-text);
    background: transparent;
    font-size: 0.92rem;
}

.field-control input::placeholder {
    color: #a4afbb;
    opacity: 1;
}

.password-toggle {
    display: grid;
    flex: 0 0 auto;
    width: 50px;
    align-self: stretch;
    padding: 0;
    border: 0;
    outline: 0;
    color: #8290a0;
    background: transparent;
    cursor: pointer;
    place-items: center;
    transition: color 160ms ease, background-color 160ms ease;
}

.password-toggle:hover {
    color: var(--login-blue);
    background: rgba(10, 132, 255, 0.06);
}

.password-toggle:focus-visible {
    color: var(--login-blue);
    box-shadow: inset 0 0 0 2px var(--login-blue);
}

.validation-summary:empty,
.validation-summary-valid {
    display: none;
}

.validation-summary-errors {
    color: var(--login-danger);
    font-size: 0.8rem;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 20px;
}

.login-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    margin-top: 4px;
    padding: 0 24px;
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--login-blue), var(--login-blue-dark));
    box-shadow: 0 14px 28px rgba(0, 110, 214, 0.24);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 750;
    letter-spacing: 0.01em;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.login-submit::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
    content: "";
    transform: translateX(-110%);
    transition: transform 500ms ease;
}

.login-submit:hover:not(:disabled) {
    box-shadow: 0 18px 34px rgba(0, 110, 214, 0.3);
    filter: saturate(1.08);
    transform: translateY(-2px);
}

.login-submit:hover:not(:disabled)::before {
    transform: translateX(110%);
}

.login-submit:active:not(:disabled) {
    box-shadow: 0 10px 20px rgba(0, 110, 214, 0.22);
    transform: translateY(0);
}

.login-submit:focus-visible {
    outline: 3px solid rgba(10, 132, 255, 0.3);
    outline-offset: 3px;
}

.login-submit:disabled {
    cursor: wait;
    opacity: 0.78;
}

.login-submit__arrow {
    position: absolute;
    right: 22px;
    font-size: 0.78rem;
    transition: transform 160ms ease;
}

.login-submit:hover:not(:disabled) .login-submit__arrow {
    transform: translateX(3px);
}

.login-submit__spinner {
    display: none;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: login-spin 700ms linear infinite;
}

.login-submit.is-loading .login-submit__spinner {
    display: inline-block;
}

.login-submit.is-loading .login-submit__arrow {
    display: none;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: #8794a3;
    font-size: 0.7rem;
    line-height: 1.45;
    text-align: center;
}

.security-note i {
    color: #62a07d;
    font-size: 0.66rem;
}

.login-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 42px;
    color: #9aa6b2;
    font-size: 0.68rem;
    line-height: 1.5;
    text-align: center;
}

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

@keyframes sacred-rotation {
    to {
        transform: rotate(360deg);
    }
}

@keyframes aurora-drift {
    0% {
        transform: translate3d(-3%, -2%, 0) rotate(-3deg) scale(1);
    }
    50% {
        transform: translate3d(4%, 3%, 0) rotate(4deg) scale(1.08);
    }
    100% {
        transform: translate3d(-1%, 5%, 0) rotate(-1deg) scale(1.04);
    }
}

@keyframes glow-float-top {
    to {
        transform: translate3d(-22vw, 20vh, 0) scale(1.16);
    }
}

@keyframes glow-float-middle {
    to {
        transform: translate3d(30vw, -18vh, 0) scale(0.88);
    }
}

@keyframes glow-float-bottom {
    to {
        transform: translate3d(24vw, -16vh, 0) scale(1.2);
    }
}

@keyframes phrase-reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .login-page {
        padding: 24px;
    }

    .auth-shell {
        grid-template-columns: minmax(300px, 0.78fr) minmax(390px, 1.22fr);
    }

    .brand-panel {
        padding: 42px 36px 34px;
    }

    .form-panel {
        padding: 50px 42px 30px;
    }
}

@media (max-width: 720px) {
    .login-page {
        place-items: start center;
    }

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

    .brand-panel {
        min-height: 310px;
        padding: 30px 32px;
    }

    .brand-copy {
        align-items: flex-start;
        margin-top: 38px;
        padding: 0;
    }

    .brand-message {
        max-width: 500px;
        font-size: clamp(1.7rem, 8vw, 2.25rem);
    }

    .brand-message-group {
        gap: 18px;
    }

    .present-message {
        max-width: 500px;
        font-size: 0.82rem;
        line-height: 1.55;
    }

    .form-panel {
        border-top: 1px solid rgba(255, 255, 255, 0.76);
        border-left: 0;
        padding: 42px 32px 28px;
    }

    .form-panel__content {
        width: min(100%, 500px);
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 0;
        overflow: visible;
    }

    .auth-shell {
        min-height: 100vh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .brand-panel {
        min-height: 290px;
        padding: max(26px, env(safe-area-inset-top)) 24px 26px;
    }

    .brand-mark {
        width: 43px;
        height: 43px;
        border-radius: 13px;
        font-size: 21px;
    }

    .brand-name {
        font-size: 21px;
    }

    .brand-copy {
        margin-top: 35px;
    }

    .form-panel {
        padding: 36px 24px max(24px, env(safe-area-inset-bottom));
    }

    .form-header h1 {
        font-size: 2rem;
    }

    .field-label-row span {
        display: none;
    }

    .login-footer {
        margin-top: 34px;
    }
}

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