/* ITAMS auth — brand-first guest screens */

:root {
    --auth-ink: #142029;
    --auth-muted: #5c6d78;
    --auth-line: #d2dde4;
    --auth-panel: #eef3f6;
    --auth-surface: #ffffff;
    --auth-brand: #07353d;
    --auth-brand-deep: #042429;
    --auth-brand-mid: #0c4a54;
    --auth-accent: #1a9b8c;
    --auth-accent-deep: #147a6e;
    --auth-danger: #c0392b;
    --auth-success: #1a7a4c;
    --auth-radius: 10px;
    --auth-font: "Figtree", system-ui, sans-serif;
    --auth-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
}

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

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

body.auth-body {
    font-family: var(--auth-font);
    color: var(--auth-ink);
    background: var(--auth-panel);
    -webkit-font-smoothing: antialiased;
}

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

/* —— Brand plane (full-bleed visual) —— */
.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(2rem, 5vw, 4.5rem);
    color: #e8f4f2;
    background:
        linear-gradient(165deg, var(--auth-brand-deep) 0%, var(--auth-brand) 48%, var(--auth-brand-mid) 100%);
}

.auth-brand__atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-brand__mesh {
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    transform: rotate(-8deg);
    mask-image: radial-gradient(ellipse 70% 65% at 55% 40%, #000 15%, transparent 72%);
    animation: auth-mesh 36s linear infinite;
}

.auth-brand__scan {
    position: absolute;
    left: -10%;
    right: -10%;
    height: 28%;
    top: 18%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(26, 155, 140, 0.12) 45%,
        transparent 100%
    );
    animation: auth-scan 7.5s ease-in-out infinite;
}

.auth-brand__scene {
    position: absolute;
    right: clamp(1rem, 6vw, 4rem);
    top: 50%;
    width: min(340px, 48vw);
    transform: translateY(-58%);
    color: #dff5f1;
}

.auth-brand__rack {
    width: 100%;
    height: auto;
    opacity: 0.9;
    animation: auth-rise 1s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-tag {
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 7.5rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(232, 244, 242, 0.28);
    border-radius: 8px;
    background: rgba(4, 36, 41, 0.55);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    animation: auth-float 6.5s ease-in-out infinite;
}

.auth-tag__code {
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: rgba(232, 244, 242, 0.65);
}

.auth-tag__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
}

.auth-tag--a {
    top: 8%;
    left: -4%;
    animation-delay: 0s;
}

.auth-tag--b {
    top: 42%;
    right: -6%;
    animation-delay: -2.2s;
}

.auth-tag--c {
    bottom: 6%;
    left: 18%;
    animation-delay: -4s;
}

.auth-brand__content {
    position: relative;
    z-index: 2;
    max-width: 26rem;
    animation: auth-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-brand__eyebrow {
    margin: 0 0 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(232, 244, 242, 0.62);
}

.auth-brand__name {
    margin: 0;
    font-family: var(--auth-display);
    font-size: clamp(3.5rem, 9vw, 6rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.045em;
    color: #fff;
}

.auth-brand__tagline {
    margin: 1.35rem 0 0;
    max-width: 22rem;
    font-size: 1.08rem;
    line-height: 1.55;
    font-weight: 500;
    color: rgba(232, 244, 242, 0.78);
}

.auth-brand__footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding-top: 3rem;
    font-size: 0.8rem;
    color: rgba(232, 244, 242, 0.4);
    animation: auth-rise 0.95s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* —— Form plane —— */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(26, 155, 140, 0.07), transparent 55%),
        var(--auth-panel);
}

.auth-panel__inner {
    width: 100%;
    max-width: 23.5rem;
    animation: auth-rise 0.75s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-panel__mobile-brand {
    display: none;
    margin: 0 0 1.5rem;
    font-family: var(--auth-display);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--auth-brand);
}

.auth-intro {
    margin-bottom: 1.75rem;
}

.auth-heading {
    margin: 0 0 0.4rem;
    font-family: var(--auth-display);
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--auth-ink);
}

.auth-subheading {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--auth-muted);
}

.auth-status {
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: var(--auth-radius);
    background: rgba(26, 122, 76, 0.09);
    color: var(--auth-success);
    font-size: 0.875rem;
    font-weight: 600;
}

.auth-form {
    margin: 0;
}

.auth-field {
    margin-bottom: 1.1rem;
}

.auth-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--auth-ink);
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 0.9rem;
    width: 1.1rem;
    height: 1.1rem;
    color: #7a8c97;
    pointer-events: none;
}

.auth-input-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.auth-input {
    display: block;
    width: 100%;
    height: 3.05rem;
    padding: 0 1rem 0 2.65rem;
    border: 1.5px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background: var(--auth-surface);
    color: var(--auth-ink);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input--password {
    padding-right: 3rem;
}

.auth-input::placeholder {
    color: #94a3ad;
}

.auth-input:hover {
    border-color: #b5c4cd;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(26, 155, 140, 0.18);
}

.auth-input.is-invalid {
    border-color: var(--auth-danger);
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.14);
}

.auth-reveal {
    position: absolute;
    right: 0.35rem;
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6d7f8a;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.auth-reveal:hover {
    color: var(--auth-ink);
    background: rgba(20, 32, 41, 0.05);
}

.auth-reveal svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
}

.auth-reveal__hide {
    display: none;
}

.auth-reveal.is-revealed .auth-reveal__show {
    display: none;
}

.auth-reveal.is-revealed .auth-reveal__hide {
    display: block;
}

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

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.15rem 0 1.45rem;
    flex-wrap: wrap;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

.auth-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-accent-deep);
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: var(--auth-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    height: 3.15rem;
    border: 0;
    border-radius: var(--auth-radius);
    background: var(--auth-accent);
    color: #fff;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.15s ease;
}

.auth-submit svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s ease;
}

.auth-submit:hover {
    background: var(--auth-accent-deep);
    transform: translateY(-1px);
}

.auth-submit:hover svg {
    transform: translateX(3px);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 155, 140, 0.28);
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-mesh {
    from {
        transform: rotate(-8deg) translate(0, 0);
    }
    to {
        transform: rotate(-8deg) translate(56px, 56px);
    }
}

@keyframes auth-scan {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    50% {
        transform: translateY(120%);
        opacity: 0.7;
    }
}

@keyframes auth-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 38vh;
        justify-content: flex-end;
        padding: 1.5rem 1.35rem 1.75rem;
    }

    .auth-brand__scene {
        width: min(220px, 42vw);
        right: 0.75rem;
        top: 42%;
        opacity: 0.85;
    }

    .auth-tag--c {
        display: none;
    }

    .auth-brand__name {
        font-size: clamp(2.75rem, 14vw, 3.75rem);
    }

    .auth-brand__tagline {
        font-size: 0.95rem;
        margin-top: 0.85rem;
        max-width: 18rem;
    }

    .auth-brand__footer {
        display: none;
    }

    .auth-panel {
        align-items: flex-start;
        padding-top: 1.75rem;
        padding-bottom: 2.75rem;
    }

    .auth-panel__mobile-brand {
        display: none;
    }
}

@media (max-width: 520px) {
    .auth-brand__scene {
        opacity: 0.35;
    }

    .auth-tag {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand__mesh,
    .auth-brand__scan,
    .auth-brand__rack,
    .auth-tag,
    .auth-brand__content,
    .auth-brand__footer,
    .auth-panel__inner {
        animation: none;
    }

    .auth-submit:hover,
    .auth-submit:hover svg {
        transform: none;
    }
}
