/* Administration authentication shell. */
:root {
    --auth-ink: #27384c;
    --auth-muted: #677687;
    --auth-line: #d8e0eb;
    --auth-panel: #ffffff;
    --auth-field: #f7fafc;
    --auth-blue: #64758f;
    --auth-blue-dark: #4f627f;
    --auth-teal: #5f8b80;
    --auth-amber: #8f6a28;
    --auth-red: #8e343e;
    --auth-green: #2d7d5f;
    --auth-shadow: 0 18px 42px rgba(35, 56, 84, 0.18);
}

* {
    box-sizing: border-box;
}

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

body.auth-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    font-family: Aptos, "Segoe UI", Inter, Arial, sans-serif;
    color: var(--auth-ink);
    background:
        linear-gradient(90deg, rgba(90, 106, 130, 0.06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(82, 127, 115, 0.05) 1px, transparent 1px),
        #f2f6fb;
    background-size: 28px 28px;
}

button,
input,
select {
    font: inherit;
}

.auth-shell {
    width: min(1120px, calc(100vw - 32px));
    min-height: min(680px, calc(100vh - 32px));
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.82fr);
    overflow: hidden;
    border: 1px solid rgba(206, 214, 229, 0.95);
    border-radius: 8px;
    background: var(--auth-panel);
    box-shadow: var(--auth-shadow);
}

.brand-panel {
    position: relative;
    display: grid;
    align-content: space-between;
    min-height: 100%;
    padding: 36px;
    overflow: hidden;
    color: #f2f6fc;
    background:
        linear-gradient(135deg, rgba(47, 68, 92, 0.96), rgba(73, 95, 127, 0.94) 55%, rgba(78, 117, 103, 0.94)),
        #30445a;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.05));
    pointer-events: none;
}

.brand-copy,
.brand-status,
.service-map {
    position: relative;
    z-index: 1;
}

.brand-mark {
    position: relative;
    width: 92px;
    height: 88px;
    margin-bottom: 22px;
}

.house-roof {
    position: absolute;
    left: 13px;
    top: 2px;
    width: 66px;
    height: 66px;
    border-top: 7px solid #ffffff;
    border-left: 7px solid #ffffff;
    transform: rotate(45deg);
    border-radius: 7px 0 0 0;
}

.house-body {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 55px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.08);
}

.house-body span {
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.25);
    animation: servicePulse 3.2s ease-in-out infinite;
}

.house-body span:nth-child(2) {
    animation-delay: 0.45s;
}

.house-body span:nth-child(3) {
    animation-delay: 0.9s;
}

.house-body span:nth-child(4) {
    animation-delay: 1.35s;
}

.house-hub {
    position: absolute;
    left: 39px;
    top: 36px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #b78f45;
    box-shadow: 0 0 0 6px rgba(197, 141, 42, 0.12);
}

.eyebrow {
    margin: 0 0 8px;
    color: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    opacity: 0.78;
}

.brand-copy h1 {
    max-width: 560px;
    margin: 0;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.02;
    letter-spacing: 0;
}

.brand-summary {
    max-width: 520px;
    margin: 18px 0 0;
    color: rgba(248, 251, 255, 0.82);
    font-size: 15px;
    line-height: 1.55;
}

.service-map {
    height: 246px;
    margin: 24px 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.service-line {
    position: absolute;
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
    transform-origin: left center;
    animation: lineSignal 4.4s linear infinite;
}

.line-a {
    left: 17%;
    top: 42%;
    width: 64%;
    transform: rotate(-13deg);
}

.line-b {
    left: 18%;
    top: 59%;
    width: 58%;
    transform: rotate(16deg);
    animation-delay: 1.1s;
}

.line-c {
    left: 28%;
    top: 23%;
    width: 46%;
    transform: rotate(31deg);
    animation-delay: 2.2s;
}

.service-node {
    position: absolute;
    display: grid;
    place-items: center;
    min-width: 48px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(31, 43, 61, 0.46);
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    animation: nodeFloat 5.6s ease-in-out infinite;
}

.node-cf {
    left: 12%;
    top: 16%;
    border-color: rgba(197, 141, 42, 0.72);
}

.node-amb {
    right: 12%;
    top: 18%;
    border-color: rgba(82, 127, 115, 0.72);
    animation-delay: 0.7s;
}

.node-xd {
    left: 43%;
    top: 8%;
    animation-delay: 1.1s;
}

.node-fin {
    left: 18%;
    bottom: 18%;
    border-color: rgba(110, 130, 177, 0.72);
    animation-delay: 1.5s;
}

.node-hr {
    right: 18%;
    bottom: 16%;
    border-color: rgba(165, 61, 61, 0.72);
    animation-delay: 2s;
}

.node-vas {
    left: 46%;
    top: 45%;
    border-color: rgba(82, 127, 115, 0.72);
    animation-delay: 2.4s;
}

.node-anl {
    left: 9%;
    top: 52%;
    animation-delay: 2.9s;
}

.node-tool {
    right: 8%;
    top: 52%;
    animation-delay: 3.3s;
}

.brand-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brand-status span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 800;
}

.auth-panel {
    display: grid;
    align-items: center;
    padding: 34px;
    background: #f7f9fc;
}

.auth-card {
    width: 100%;
    padding: 24px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.auth-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.auth-card h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.18;
    letter-spacing: 0;
}

.auth-card .eyebrow {
    color: var(--auth-teal);
}

.secure-badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 8px;
    color: var(--auth-green);
    background: rgba(42, 117, 77, 0.1);
    font-size: 11px;
    font-weight: 800;
}

.auth-htmx-indicator {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 8px;
    color: var(--auth-blue-dark);
    background: rgba(90, 106, 130, 0.08);
    font-size: 11px;
    font-weight: 800;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    background: #eff3f8;
}

.auth-tab {
    min-height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    color: var(--auth-muted);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.auth-tab.active {
    color: #ffffff;
    background: var(--auth-blue);
    box-shadow: 0 6px 14px rgba(90, 106, 130, 0.2);
}

.auth-form {
    display: none;
    gap: 12px;
}

.auth-form.active {
    display: grid;
}

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

.field-group label {
    color: #596a7f;
    font-size: 12px;
    font-weight: 800;
}

.auth-field-note {
    color: var(--auth-muted);
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
}

.field-group input,
.field-group select {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--auth-line);
    border-radius: 6px;
    color: var(--auth-ink);
    background: var(--auth-field);
    font-size: 13px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field-group select {
    cursor: pointer;
}

.field-group input:focus,
.field-group select:focus {
    border-color: rgba(90, 106, 130, 0.82);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(90, 106, 130, 0.13);
}

.field-group.has-error input,
.field-group.has-error select {
    border-color: rgba(165, 61, 61, 0.78);
    box-shadow: 0 0 0 3px rgba(165, 61, 61, 0.08);
}

.field-group small {
    color: var(--auth-red);
    font-size: 11px;
    font-weight: 700;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 58px;
}

.password-toggle {
    position: absolute;
    right: 5px;
    top: 5px;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--auth-blue-dark);
    background: #eaf0f8;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    border-color: rgba(90, 106, 130, 0.28);
    background: #dde8f3;
}

.primary-action {
    min-height: 38px;
    margin-top: 2px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: var(--auth-blue);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(90, 106, 130, 0.22);
}

.primary-action:hover,
.primary-action:focus-visible {
    background: var(--auth-blue-dark);
}

.auth-alert {
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.auth-alert.error {
    color: var(--auth-red);
    border: 1px solid #f3d4d9;
    background: #fdf0f2;
}

.auth-alert.success {
    color: var(--auth-green);
    border: 1px solid rgba(42, 117, 77, 0.22);
    background: rgba(42, 117, 77, 0.09);
}

@keyframes servicePulse {
    0%,
    100% {
        background: rgba(255, 255, 255, 0.22);
    }

    45% {
        background: rgba(197, 141, 42, 0.78);
    }
}

@keyframes lineSignal {
    0% {
        opacity: 0.18;
        box-shadow: none;
    }

    48% {
        opacity: 0.62;
        box-shadow: 0 0 16px rgba(255, 255, 255, 0.35);
    }

    100% {
        opacity: 0.18;
        box-shadow: none;
    }
}

@keyframes nodeFloat {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .house-body span,
    .service-line,
    .service-node {
        animation: none;
    }

    .service-node {
        translate: none !important;
    }

    .auth-form input,
    .auth-form select {
        transition: none;
    }
}

@media (max-width: 860px) {
    body.auth-page {
        place-items: stretch;
    }

    .auth-shell {
        width: 100%;
        min-height: 100vh;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
    }

    .brand-panel {
        min-height: 320px;
        padding: 24px;
    }

    .brand-copy h1 {
        font-size: 32px;
    }

    .service-map {
        height: 160px;
        margin: 18px 0 0;
    }

    .brand-status {
        display: none;
    }

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

@media (max-width: 520px) {
    .brand-panel {
        min-height: 250px;
    }

    .brand-mark {
        width: 70px;
        height: 68px;
        margin-bottom: 14px;
        transform: scale(0.8);
        transform-origin: left top;
    }

    .brand-summary,
    .service-map {
        display: none;
    }

    .auth-panel {
        align-items: start;
        padding: 16px;
    }

    .auth-card {
        padding: 18px;
    }

    .auth-card-header {
        display: grid;
        gap: 8px;
    }
}
