/* ============================================================
   V2.0.63 Authentication surfaces
   Shared by tenant login / registration / password recovery
   and administrator login.
   ============================================================ */

.auth-body {
    min-height: 100vh;
    margin: 0;
    background: #f4f7fb;
    color: #12243a;
    font-family: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(470px, 0.94fr);
    min-height: 100vh;
}

/* ------------------------------ Brand panel ------------------------------ */
.auth-aside {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 38px 52px 42px;
    overflow: hidden;
    background:
        radial-gradient(720px 520px at 88% -6%, rgba(34, 211, 238, 0.17), transparent 64%),
        radial-gradient(620px 480px at 0% 100%, rgba(47, 125, 246, 0.2), transparent 62%),
        linear-gradient(135deg, #06172a 0%, #09223c 54%, #0b2e4f 100%);
    color: #fff;
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 184, 220, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 184, 220, 0.055) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(ellipse at 55% 26%, #000 18%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 55% 26%, #000 18%, transparent 78%);
    pointer-events: none;
}

.auth-aside::after {
    content: "";
    position: absolute;
    right: -170px;
    bottom: -220px;
    width: 540px;
    height: 540px;
    border: 1px solid rgba(94, 234, 212, 0.14);
    border-radius: 50%;
    box-shadow: 0 0 0 70px rgba(94, 234, 212, 0.025), 0 0 0 150px rgba(47, 125, 246, 0.02);
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    color: #fff;
}

.auth-brand:hover {
    text-decoration: none;
}

.auth-brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(145deg, #2f7df6, #1668e3 56%, #0b3f9e);
    box-shadow: 0 13px 26px -12px rgba(47, 125, 246, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.auth-brand-mark svg {
    width: 21px;
    height: 21px;
}

.auth-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.auth-brand-copy strong {
    color: #f3f9ff;
    font-size: 15px;
    font-weight: 720;
    letter-spacing: -0.02em;
}

.auth-brand-copy small {
    margin-top: 3px;
    color: #6d89a5;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.auth-aside-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    margin: 54px 0;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 22px;
    color: #66e3d2;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.auth-kicker::before {
    content: "";
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #2dd4bf);
}

.auth-aside-title {
    margin-bottom: 18px;
    color: #f7fbff;
    font-size: 45px;
    line-height: 1.16;
    font-weight: 760;
    letter-spacing: -0.04em;
}

.auth-aside-title em {
    color: #7dd3fc;
    font-style: normal;
}

.auth-aside-desc {
    max-width: 460px;
    margin-bottom: 30px;
    color: #9fb8d0;
    font-size: 14.5px;
    line-height: 1.8;
}

.auth-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #b9cce0;
    font-size: 12.5px;
    line-height: 1.65;
}

.auth-points svg {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    padding: 3px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.14);
    color: #5eead4;
}

.auth-signal-card {
    position: relative;
    z-index: 2;
    width: min(430px, 100%);
    padding: 17px 18px;
    border: 1px solid rgba(148, 184, 220, 0.17);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.auth-signal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
}

.auth-signal-head strong {
    color: #dfefff;
    font-size: 11.5px;
    font-weight: 650;
}

.auth-signal-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #6ee7b7;
    font-size: 9px;
    font-weight: 700;
}

.auth-signal-live::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.1);
}

.auth-signal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-top: 1px solid rgba(148, 184, 220, 0.1);
    color: #8aa5bf;
    font-size: 10px;
}

.auth-signal-row b {
    color: #c6e2f7;
    font-size: 10px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.auth-signal-row b.ok {
    color: #6ee7b7;
}

.auth-aside-foot {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #5f7e9b;
    font-size: 9.5px;
    letter-spacing: 0.04em;
}

/* ------------------------------ Form side ------------------------------ */
.auth-main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 26px 42px 24px;
    overflow-y: auto;
    background:
        radial-gradient(700px 420px at 100% 0%, rgba(47, 125, 246, 0.055), transparent 68%),
        #f4f7fb;
}

.auth-main-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    color: #8b9db0;
    font-size: 11px;
}

.auth-main-top a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #5c7187;
    font-weight: 550;
}

.auth-main-top a:hover {
    color: #1668e3;
}

.auth-main-top span {
    letter-spacing: 0.02em;
}

.auth-card-wrap {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 30px 0;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    padding: 32px 32px 28px;
    border: 1px solid #dfe8f3;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 70px -42px rgba(7, 26, 47, 0.4), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.auth-card-wide {
    max-width: 540px;
}

.auth-card-head {
    margin-bottom: 24px;
}

.auth-eyebrow {
    display: block;
    margin-bottom: 9px;
    color: #1668e3;
    font-size: 9.5px;
    font-weight: 760;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-title {
    margin-bottom: 7px;
    color: #0d1f35;
    font-size: 25px;
    line-height: 1.25;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    margin: 0;
    color: #73879d;
    font-size: 12.5px;
    line-height: 1.65;
}

.auth-legal {
    display: flex;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding-top: 10px;
    color: #9aabbe;
    font-size: 10.5px;
}

.auth-legal a {
    color: #788da3;
}

.auth-legal a:hover {
    color: #1668e3;
}

/* ------------------------------ Alerts ------------------------------ */
.auth-card .alert,
.auth-card .login-error,
.auth-card .login-success,
.auth-card .error-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 17px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.65;
}

.auth-card .login-error,
.auth-card .error-box,
.auth-card .alert-danger {
    border-color: #f3cdd2;
    background: #fff3f4;
    color: #b42338;
}

.auth-card .login-success,
.auth-card .alert-success {
    border-color: #bdeedb;
    background: #eefbf5;
    color: #0b7a55;
}

.auth-card .alert-warning {
    border-color: #f2ddb4;
    background: #fff9ed;
    color: #975b07;
}

.auth-card .alert-info {
    border-color: #cfe1f8;
    background: #eff6ff;
    color: #145bcc;
}

.login-error svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ------------------------------ Tabs ------------------------------ */
.login-tabs {
    display: flex;
    gap: 3px;
    padding: 4px;
    margin-bottom: 21px;
    border: 1px solid #e5edf6;
    border-radius: 10px;
    background: #f4f7fb;
}

.login-tab {
    flex: 1;
    padding: 9px 6px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #71859a;
    font-size: 12px;
    font-weight: 580;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.login-tab:hover {
    color: #30557f;
}

.login-tab.active {
    background: #fff;
    color: #145bcc;
    font-weight: 650;
    box-shadow: 0 2px 8px -4px rgba(20, 51, 88, 0.35);
}

.login-pane {
    display: none;
}

.login-pane.active {
    display: block;
}

/* ------------------------------ Fields ------------------------------ */
.auth-card .form-group {
    margin-bottom: 15px;
}

.auth-card .form-label {
    display: block;
    margin-bottom: 6px;
    color: #3b5068;
    font-size: 12px;
    font-weight: 620;
}

.auth-card .form-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid #d7e2ee;
    border-radius: 9px;
    background: #fbfdff;
    color: #12243a;
    font-size: 13px;
    transition: border-color 0.17s ease, box-shadow 0.17s ease, background 0.17s ease;
}

.auth-card .form-input:hover {
    border-color: #bccfe3;
}

.auth-card .form-input:focus {
    outline: none;
    border-color: #2f7df6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.12);
}

.auth-card .form-input::placeholder {
    color: #9bacbe;
}

.auth-card select.form-input {
    cursor: pointer;
}

.captcha-row {
    display: flex;
    gap: 9px;
    align-items: stretch;
}

.captcha-row .form-input {
    flex: 1;
    min-width: 0;
}

.captcha-img {
    width: 122px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid #d7e2ee;
    border-radius: 8px;
    background: #f2f8ff;
    cursor: pointer;
}

.code-row {
    display: flex;
    gap: 9px;
}

.code-row .form-input {
    flex: 1;
    min-width: 0;
}

.send-code-btn {
    height: 44px;
    padding: 0 13px;
    border: 1px solid #bdd6f4;
    border-radius: 9px;
    background: #f2f8ff;
    color: #145bcc;
    font-size: 11.5px;
    font-weight: 620;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.send-code-btn:hover {
    border-color: #9fc2ec;
    background: #eaf4ff;
}

.send-code-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.login-help,
.auth-card .field-hint {
    margin-top: 5px;
    color: #92a3b6;
    font-size: 10.5px;
    line-height: 1.6;
}

.auth-card .field-hint strong {
    color: #3e7cc8;
    font-weight: 620;
}

.code-status {
    display: none;
    margin-top: 7px;
    font-size: 10.5px;
}

.code-status.ok {
    display: block;
    color: #0b7a55;
}

.code-status.fail {
    display: block;
    color: #c02c50;
}

/* ------------------------------ Submit and links ------------------------------ */
.auth-card .btn-primary,
.auth-card .btn-submit {
    width: 100%;
    min-height: 44px;
    margin-top: 5px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, #2f7df6 0%, #1668e3 56%, #0d4fbf 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 12px 26px -14px rgba(22, 104, 227, 0.66), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.17s ease, box-shadow 0.17s ease, background 0.17s ease;
}

.auth-card .btn-primary:hover,
.auth-card .btn-submit:hover {
    background: linear-gradient(135deg, #3b8bff 0%, #176fe8 56%, #0b47ad 100%);
    box-shadow: 0 16px 30px -14px rgba(22, 104, 227, 0.72);
    transform: translateY(-1px);
}

.login-links-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    font-size: 11.5px;
}

.login-links-row a,
.login-bottom-links a,
.register-links a,
.back-link a,
.login-footer a {
    color: #1668e3;
    font-weight: 600;
}

.login-links-row a:hover,
.login-bottom-links a:hover,
.register-links a:hover,
.back-link a:hover,
.login-footer a:hover {
    color: #0d4fbf;
}

.login-divider {
    position: relative;
    margin-top: 18px;
    color: #98a9bb;
    font-size: 10.5px;
    line-height: 1.6;
    text-align: center;
}

.login-bottom-links {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf2f8;
    color: #8b9db0;
    font-size: 11.5px;
    text-align: center;
}

.login-footer {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf2f8;
    color: #8b9db0;
    font-size: 11.5px;
    text-align: center;
}

.register-links {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf2f8;
    color: #8b9db0;
    font-size: 11.5px;
    text-align: center;
}

.back-link {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf2f8;
    font-size: 11.5px;
    text-align: center;
}

.auth-card .error-box {
    margin-bottom: 17px;
}

/* Register-specific */
.auth-card .register-form .form-group {
    margin-bottom: 13px;
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 1180px) {
    .auth-aside {
        padding: 34px 40px 38px;
    }

    .auth-aside-title {
        font-size: 38px;
    }

    .auth-main {
        padding: 24px 32px 20px;
    }
}

@media (max-width: 960px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-aside {
        position: relative;
        display: block;
        min-height: 0;
        padding: 26px 28px 30px;
    }

    .auth-aside-content {
        margin: 34px 0 0;
    }

    .auth-aside-title {
        max-width: 620px;
        font-size: 32px;
    }

    .auth-aside-desc {
        margin-bottom: 0;
    }

    .auth-points,
    .auth-signal-card,
    .auth-aside-foot {
        display: none;
    }

    .auth-main {
        min-height: auto;
        padding: 20px 24px 22px;
    }

    .auth-main-top {
        max-width: 540px;
        margin: 0 auto;
    }

    .auth-card-wrap {
        padding: 24px 0;
    }
}

@media (max-width: 560px) {
    .auth-aside {
        padding: 20px 18px 24px;
    }

    .auth-brand-mark {
        width: 36px;
        height: 36px;
    }

    .auth-aside-content {
        margin-top: 26px;
    }

    .auth-kicker {
        margin-bottom: 15px;
        font-size: 9px;
    }

    .auth-aside-title {
        font-size: 25px;
        line-height: 1.3;
        letter-spacing: -0.02em;
    }

    .auth-aside-desc {
        font-size: 12.5px;
    }

    .auth-main {
        padding: 16px 14px 20px;
    }

    .auth-main-top {
        padding: 0 4px;
    }

    .auth-main-top span {
        display: none;
    }

    .auth-card-wrap {
        padding: 18px 0;
    }

    .auth-card {
        padding: 24px 20px 22px;
        border-radius: 16px;
    }

    .auth-title {
        font-size: 22px;
    }

    .auth-legal {
        flex-wrap: wrap;
        gap: 8px 14px;
        padding: 4px 6px 0;
    }

    .captcha-img {
        width: 108px;
    }

    .login-links-row {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card .btn-primary:hover,
    .auth-card .btn-submit:hover {
        transform: none;
    }
}
