:root {
    --auth-ink: #171a1f;
    --auth-muted: #6b7280;
    --auth-line: #e6e8ec;
    --auth-surface: #ffffff;
    --auth-panel-w: 520px;
}

html, body.auth-body {
    margin: 0;
    min-height: 100%;
    background: var(--auth-surface);
    color: var(--auth-ink);
    font-size: 15px;
}

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.auth-visual {
    position: relative;
    overflow: hidden;
    background: var(--bg-main, #f6f7f9);
}

.auth-visual-img {
    position: absolute;
    inset: 0;
    display: block;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-visual-img ~ .auth-visual-img { display: none; }

.auth-points {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 26px 36px;
    list-style: none;
    background: rgba(17, 20, 24, .62);
    color: #fff;
    font-size: 14px;
}

.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points i { width: 18px; text-align: center; }

.auth-visual:not(:has(.auth-visual-img)) .auth-points {
    position: static;
    height: 100%;
    justify-content: center;
    background: transparent;
    color: var(--auth-ink);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--auth-surface);
}

.auth-form-wrap { width: 100%; max-width: 380px; }

.auth-logo { display: inline-block; margin-bottom: 26px; text-decoration: none; }
.auth-logo-img { display: block; height: 46px; max-width: 220px; object-fit: contain; }
.auth-logo-text { font-size: 1.3rem; font-weight: 700; color: var(--auth-ink); }

.auth-heading { margin-bottom: 22px; }
.auth-title { margin: 0 0 4px; font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; color: var(--auth-ink); }
.auth-sub { margin: 0; font-size: .92rem; color: var(--auth-muted); line-height: 1.5; }
.auth-sub[hidden] { display: none; }

.auth-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 14px;
    border-radius: 50%;
    font-size: 1.25rem;
}
.auth-status.is-success { background: #e8f5ee; color: #198754; }
.auth-status.is-error { background: #fdecec; color: #c0272d; }

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--auth-line);
}
.auth-tab {
    padding: 10px 0;
    border: 0;
    background: transparent;
    font-size: .93rem;
    font-weight: 600;
    color: var(--auth-muted);
}
.auth-tab:hover { color: var(--auth-ink); }
.auth-tab.is-active { color: var(--auth-ink); box-shadow: inset 0 -2px 0 var(--auth-btn); }

.auth-form[hidden] { display: none; }
.auth-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.auth-field { margin-bottom: 14px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-panel .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--auth-ink);
}
.auth-label-row { display: flex !important; justify-content: space-between; align-items: baseline; }
.auth-link-muted { font-size: .82rem; font-weight: 500; color: var(--auth-muted); text-decoration: underline; }
.auth-link-muted:hover { color: var(--auth-ink); }

.auth-panel .form-control {
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    font-size: .93rem;
    color: var(--auth-ink);
    background: #fff;
    box-shadow: none;
}
.auth-panel .form-control::placeholder { color: #9aa1ab; }
.auth-panel .form-control:focus {
    border-color: var(--auth-btn);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-btn) 18%, transparent);
}

.password-field-wrapper { position: relative; }
.password-field-wrapper .password-toggle-input { padding-right: 44px; }
.password-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
}
.password-toggle-btn:hover { color: var(--auth-ink); }

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 2px 0 16px;
    font-size: .86rem;
    color: var(--auth-muted);
    line-height: 1.45;
    cursor: pointer;
}
.auth-check input { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; accent-color: var(--auth-btn); }
.auth-check a { color: var(--auth-ink); text-decoration: underline; }
.legal-consents { margin: 6px 0 4px; }
.legal-consents .auth-check { margin-bottom: 10px; font-size: .82rem; }

.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background: var(--auth-btn);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease;
}
.btn-auth:hover, .btn-auth:focus { background: color-mix(in srgb, var(--auth-btn), black 12%); color: #fff; }
#registerSubmitBtn:disabled { background: #9aa1ab; cursor: not-allowed; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: .78rem; color: #9aa1ab; }
.auth-divider:before, .auth-divider:after { content: ""; flex: 1; border-top: 1px solid var(--auth-line); }

.google-auth-block .auth-check { margin-bottom: 12px; font-size: .82rem; }
.google-btn-slot { display: flex; justify-content: center; min-height: 44px; transition: opacity .2s ease; }
.auth-hint { margin-top: 6px; font-size: .8rem; color: var(--auth-muted); text-align: center; }
.auth-hint[hidden] { display: none; }
.auth-legal { margin: 12px 0 0; font-size: .8rem; color: var(--auth-muted); line-height: 1.55; }
.auth-legal a { color: var(--auth-ink); text-decoration: underline; }

.auth-note { margin: 18px 0 0; font-size: .85rem; color: var(--auth-muted); }

.auth-guest {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--auth-line);
    font-size: .86rem;
    color: var(--auth-muted);
}
.auth-guest a { color: var(--auth-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.auth-guest a:hover { text-decoration: underline; }

.auth-back { margin: 22px 0 0; font-size: .88rem; }
.auth-back a { color: var(--auth-muted); text-decoration: none; }
.auth-back a:hover { color: var(--auth-ink); }

.auth-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #f3c2c2;
    border-radius: 8px;
    background: #fdecec;
    color: #9b1c1c;
    font-size: .86rem;
}

.password-requirements {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}
.password-requirements li { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--auth-muted); }
.password-requirements li i { font-size: .8rem; color: #c3c8cf; }
.password-requirements li.is-valid, .password-requirements li.is-valid i { color: #198754; }

.otp-modal-content { border: 0; border-radius: 12px; }
.otp-modal-content .modal-title { font-weight: 700; }
#otpModalEmail { font-weight: 600; color: var(--auth-ink); }
.otp-box-group { display: flex; justify-content: center; gap: 10px; }
.otp-box {
    width: 46px;
    height: 54px;
    border: 1px solid #c9ced6;
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: var(--auth-ink);
}
.otp-box:focus { outline: none; border-color: var(--auth-btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-btn) 20%, transparent); }
.otp-box.is-invalid { border-color: #dc3545; }
.otp-resend-link { color: var(--auth-ink) !important; font-weight: 600; text-decoration: none; }
.otp-resend-link:hover { text-decoration: underline; }
.otp-resend-link:disabled { color: #9aa1ab !important; }

@media (min-width: 992px) {
    .auth-layout--split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .auth-layout--split_right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
    .auth-layout--split_right .auth-visual { order: 2; }

    .auth-layout--cover { grid-template-columns: minmax(0, 1fr) minmax(0, var(--auth-panel-w)); }
    .auth-layout--cover .auth-visual { grid-column: 1 / -1; grid-row: 1; }
    .auth-layout--cover .auth-panel { grid-column: 2; grid-row: 1; z-index: 1; border-left: 1px solid var(--auth-line); }
    .auth-layout--cover .auth-points { right: var(--auth-panel-w); }

    .auth-layout--plain { place-items: center; padding: 40px 16px; background: var(--bg-main, #f6f7f9); }
    .auth-layout--plain .auth-panel {
        width: 100%;
        max-width: 460px;
        padding: 38px 36px;
        border: 1px solid var(--auth-line);
        border-radius: 12px;
    }
}

@media (max-width: 991.98px) {
    .auth-visual { display: none; }
    .auth-page { background: var(--auth-surface); }
    .auth-panel { align-items: flex-start; padding: 32px 20px 40px; }
}

@media (max-width: 575.98px) {
    .auth-logo { display: block; margin: 0 auto 22px; text-align: center; }
    .auth-logo-img { margin: 0 auto; height: 40px; }
    .auth-title { font-size: 1.3rem; }
    .auth-row { grid-template-columns: 1fr; gap: 0; }
    .auth-guest { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 420px) {
    .otp-box { width: 40px; height: 48px; font-size: 1.2rem; }
    .otp-box-group { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .btn-auth, .google-btn-slot { transition: none; }
}
