@import url('https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap');

:root {
    --auth-teal: #008d9e;
    --auth-teal-deep: #007181;
    --auth-plum: #611f69;
    --auth-ink: #2c2430;
    --auth-muted: #8a7d90;
    --auth-line: #ddd4e0;
    --auth-bg: #ffffff;
    --auth-aside: #d0c6d1;
    --auth-danger: #c24141;
    --eh-radius-lg: 12px;
    --eh-btn-radius: 8px;
    --eh-btn-radius-sm: 4px;
}

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

html,
body.auth-body {
    margin: 0;
    min-height: 100%;
}

body.auth-body {
    font-family: "Play", sans-serif;
    color: var(--auth-ink);
    background:
        radial-gradient(900px 520px at 12% 8%, rgba(97, 31, 105, 0.08), transparent 60%),
        radial-gradient(800px 480px at 90% 100%, rgba(208, 198, 209, 0.95), transparent 55%),
        #ebe4ee;
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.auth-frame {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 6rem);
}

.auth-card {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 6rem);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border-radius: var(--eh-radius-lg, 12px);
    background: #fff;
    box-shadow:
        0 30px 70px rgba(80, 40, 90, 0.12),
        0 8px 24px rgba(80, 40, 90, 0.06);
}

.auth-aside {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-aside);
    padding: 2.5rem;
}

.auth-aside img {
    position: relative;
    z-index: 3;
    width: min(88%, 560px);
    height: auto;
    max-height: 72vh;
    object-fit: contain;
    display: block;
}

.auth-skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 168px;
    overflow: hidden;
    pointer-events: none;
}

.auth-skyline img {
    display: block;
    width: 100%;
    height: 150%;
    object-fit: cover;
    object-position: center center;
    transform: none;
    opacity: 0.34;
    filter: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.45) 36%, #000 68%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.45) 36%, #000 68%);
}

.auth-sheet {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 320px);
    margin: 0 auto;
    padding: 1.5rem 0.25rem;
    background: #fff;
}

.auth-sheet > * {
    position: relative;
    z-index: 3;
}

@media (max-width: 860px) {
    .auth-page {
        align-items: center;
        padding: 1.25rem;
    }
    .auth-frame {
        min-height: 0;
        width: min(100%, 380px);
    }
    .auth-card {
        min-height: 0;
        height: auto;
        align-content: start;
        grid-template-columns: 1fr;
        border-radius: var(--eh-radius-lg, 12px);
    }
    .auth-sheet {
        order: -1;
        width: 100%;
        padding: 1.75rem 1.25rem 1.5rem;
    }
    .auth-aside {
        display: none;
    }
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.15rem;
}

.auth-logo {
    display: block;
    object-fit: contain;
}

.auth-logo--corner {
    position: absolute;
    top: 1.15rem;
    left: 1.15rem;
    z-index: 4;
    height: 42px;
    width: auto;
    max-width: 148px;
    margin: 0;
    box-sizing: content-box;
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.94);
    border-radius: var(--eh-radius, 8px);
    box-shadow:
        0 10px 26px rgba(72, 36, 84, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
}

.auth-logo--brand {
    height: 64px;
    width: auto;
    max-width: 160px;
    margin: 0 auto 0.75rem;
}

.auth-powered {
    position: absolute;
    right: 1.35rem;
    bottom: 0.95rem;
    z-index: 4;
    color: #64748b;
    font-size: calc(0.75rem + 2px);
    font-weight: 500;
    letter-spacing: 0.03em;
    text-decoration: none;
}

.auth-powered strong {
    color: var(--auth-teal);
    font-weight: 700;
    letter-spacing: 0.01em;
}

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

.auth-powered:hover strong {
    color: var(--auth-teal-deep);
}

.auth-brand h1 {
    margin: 0;
    color: var(--auth-plum);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.15;
}

.auth-brand p {
    margin: 0.15rem 0 0;
    color: #7d888d;
    font-size: 0.82rem;
    font-weight: 500;
}

.auth-title {
    margin: 0 0 0.25rem;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--auth-plum);
}

.auth-subtitle {
    margin: 0 0 1.25rem;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.92rem;
}

.auth-field {
    position: relative;
    margin-bottom: 0.85rem;
}

.auth-outline,
.auth-control {
    position: relative;
    display: block;
    border: 1px solid var(--auth-line);
    border-radius: var(--eh-btn-radius-sm, 4px);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-outline:focus-within,
.auth-control:focus-within {
    border-color: var(--auth-teal);
    box-shadow: 0 0 0 3px rgba(0, 141, 158, 0.16);
}

.auth-outline.is-invalid,
.auth-control:has(.is-invalid) {
    border-color: var(--auth-danger);
}

.auth-outline > span,
.auth-control > .auth-float {
    position: absolute;
    top: -0.55em;
    left: 10px;
    padding: 0 6px;
    background: #fff;
    color: #9aa4a9;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1;
}

.auth-input {
    display: block;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--auth-ink);
    font: inherit;
    font-size: 0.9rem;
    padding: 0.55rem 0.7rem;
    border-radius: 4px;
}

.auth-outline .auth-input {
    padding-right: 2.4rem;
}

.auth-ico {
    display: none;
}

.auth-prefix {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-teal);
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

.auth-outline .auth-input {
    padding-left: 2.15rem;
}

.auth-eye {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #8e989d;
    padding: 0.2rem 0.35rem;
    line-height: 1;
    cursor: pointer;
}

.auth-eye:hover {
    color: var(--auth-teal);
}

.auth-error {
    display: block;
    margin-top: 0.3rem;
    color: var(--auth-danger);
    font-size: 0.78rem;
}

.auth-strength {
    margin: 0.35rem 0 0;
    color: var(--auth-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.auth-strength.is-strong {
    color: var(--auth-teal-deep);
}

.auth-meta,
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.1rem 0 0.85rem;
    font-size: 0.82rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: #4d585c;
    font-weight: 500;
    cursor: pointer;
}

.auth-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--auth-teal);
}

.auth-link {
    color: #3d474b;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-teal);
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: var(--eh-btn-radius, 8px);
    background: var(--auth-teal);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.15s ease;
}

.auth-btn:hover,
.auth-btn:focus {
    background: var(--auth-teal-deep);
    color: #fff;
}

.auth-btn:disabled,
.auth-btn.is-loading {
    opacity: 0.85;
    cursor: progress;
}

.auth-spinner {
    display: inline-block;
    width: 0.95rem;
    height: 0.95rem;
    margin-right: 0.4rem;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: authSpin 0.7s linear infinite;
}

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

.auth-alt {
    margin: 1.15rem 0 0;
    text-align: center;
    color: #3d474b;
    font-size: 0.95rem;
}

.auth-alert {
    margin-bottom: 1rem;
    padding: 0.7rem 0.8rem;
    border-radius: 4px;
    background: #fff4f4;
    color: var(--auth-danger);
    font-size: 0.88rem;
}

.auth-alert--success {
    background: #eefaf6;
    color: var(--auth-teal-deep);
}

.auth-alert__row {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
}

.auth-alert__title,
.auth-alert__text {
    display: block;
}

.auth-ghost-btn {
    display: none;
}

html[data-theme="dark"] body.auth-body,
html[data-theme="night"] body.auth-body {
    color: var(--eh-text, #e2e8f0);
    background: var(--eh-bg, #0f172a);
}

html[data-theme="dark"] .auth-card,
html[data-theme="night"] .auth-card,
html[data-theme="dark"] .auth-sheet,
html[data-theme="night"] .auth-sheet {
    background: var(--eh-surface, #1e293b);
}

html[data-theme="dark"] .auth-aside,
html[data-theme="night"] .auth-aside {
    background: #d0c6d1;
}

html[data-theme="dark"] .auth-powered,
html[data-theme="night"] .auth-powered {
    color: var(--eh-muted, #94a3b8);
}

html[data-theme="dark"] .auth-brand p,
html[data-theme="night"] .auth-brand p,
html[data-theme="dark"] .auth-check,
html[data-theme="night"] .auth-check,
html[data-theme="dark"] .auth-subtitle,
html[data-theme="night"] .auth-subtitle {
    color: var(--eh-muted, #94a3b8);
}

html[data-theme="dark"] .auth-outline,
html[data-theme="night"] .auth-outline,
html[data-theme="dark"] .auth-control,
html[data-theme="night"] .auth-control {
    background: var(--eh-input-bg, #162032);
    border-color: var(--eh-border, #334155);
}

html[data-theme="dark"] .auth-outline > span,
html[data-theme="night"] .auth-outline > span,
html[data-theme="dark"] .auth-control > .auth-float,
html[data-theme="night"] .auth-control > .auth-float {
    background: var(--eh-input-bg, #162032);
    color: var(--eh-muted, #94a3b8);
}

html[data-theme="dark"] .auth-input,
html[data-theme="night"] .auth-input {
    color: var(--eh-text, #e2e8f0);
}

html[data-theme="night"] body.auth-body {
    background: #05070c;
}

html[data-theme="night"] .auth-card,
html[data-theme="night"] .auth-sheet {
    background: #0c1018;
}

html[data-theme="night"] .auth-aside {
    background: #d0c6d1;
}

html[data-theme="night"] .auth-outline,
html[data-theme="night"] .auth-control,
html[data-theme="night"] .auth-outline > span,
html[data-theme="night"] .auth-control > .auth-float {
    background: #121826;
    border-color: #1c2433;
}

@media (max-width: 860px) {
    .auth-logo--corner {
        position: fixed;
        top: 0.85rem;
        left: 0.85rem;
        transform: none;
        z-index: 20;
    }
    .auth-powered {
        position: fixed;
        right: 0.9rem;
        bottom: 0.7rem;
        transform: none;
        z-index: 20;
    }
}
