/*
 * Sign-in pages (login, forgot password, reset password).
 *
 * A solar farm at sunrise, drawn in CSS, with a white sheet for the form. The
 * same look as the mobile app's splash and sign-in, so staff see one brand.
 * Everything is scoped under .sx-auth so it cannot touch the admin screens.
 */
@font-face {
    font-family: "Plus Jakarta Sans";
    font-weight: 500;
    font-display: swap;
    src: url("../../fonts/PlusJakartaSans-Medium.ttf") format("truetype");
}

@font-face {
    font-family: "Plus Jakarta Sans";
    font-weight: 600;
    font-display: swap;
    src: url("../../fonts/PlusJakartaSans-SemiBold.ttf") format("truetype");
}

@font-face {
    font-family: "Plus Jakarta Sans";
    font-weight: 800;
    font-display: swap;
    src: url("../../fonts/PlusJakartaSans-ExtraBold.ttf") format("truetype");
}

.sx-auth {
    --sx-primary: #005daa;
    --sx-primary-2: #007be5;
    --sx-green: #00a859;
    --sx-amber: #f59e0b;
    --sx-ink: #0f172a;
    --sx-muted: #64748b;
    --sx-line: #e2e8f0;
    --sx-field: #f1f5f9;
    --sx-horizon: 38%; /* how much of the hero is ground */
    margin: 0;
    background: #06162b;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.sx-auth .sx-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

/* ------------------------------------------------------------- the scene */
.sx-auth .sx-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    /* The same height on every page, so the sheet starts in the same place. */
    height: clamp(270px, 36vh, 340px);
    color: #fff;
    background: #06162b;
}

.sx-auth .sx-sky {
    position: absolute;
    inset: 0 0 var(--sx-horizon) 0;
    background: linear-gradient(180deg, #06162b 0%, #0b2e5c 42%, #1b5e9e 78%, #f2b35e 100%);
}

/* Darkens the top so white type stays readable. */
.sx-auth .sx-sky::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 58%);
}

.sx-auth .sx-sun {
    position: absolute;
    left: 74%;
    bottom: calc(var(--sx-horizon) - 0.5vw);
    width: clamp(54px, 7vw, 110px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #fffaf0, #ffe9a8 70%);
    box-shadow: 0 0 60px 26px rgba(255, 214, 128, 0.5), 0 0 170px 90px rgba(245, 158, 11, 0.28);
    transform: translate(-50%, 0);
    animation: sx-rise 2.4s cubic-bezier(0.22, 0.7, 0.2, 1) both;
}

.sx-auth .sx-haze {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--sx-horizon) - 26px);
    height: 52px;
    background: linear-gradient(180deg, transparent, rgba(242, 179, 94, 0.6), transparent);
    z-index: 1;
}

/* The ground: rows of panels receding to the horizon. */
.sx-auth .sx-field {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--sx-horizon);
    overflow: hidden;
    perspective: 360px;
    perspective-origin: 50% 0;
    background: linear-gradient(#0c2c55, #071c36);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 24%);
}

.sx-auth .sx-plane {
    position: absolute;
    left: -60%;
    width: 220%;
    top: 0;
    height: 320%;
    transform-origin: 50% 0;
    transform: rotateX(72deg);
    /* panel face, lit near the sun */
    background:
        radial-gradient(ellipse 30% 55% at 74% 0, rgba(125, 185, 245, 0.7), transparent 70%),
        /* cell lines */ linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px) 0 0 / 30px 100%,
        linear-gradient(0deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px) 0 0 / 100% 22px,
        /* gutters between panels */ linear-gradient(90deg, transparent 0 calc(100% - 5px), #06162b calc(100% - 5px)) 0 0 / 120px 100%,
        linear-gradient(0deg, transparent 0 calc(100% - 6px), #06162b calc(100% - 6px)) 0 0 / 100% 88px,
        linear-gradient(180deg, #0f4584, #0a2850);
}

/* A band of light slides across the field. */
.sx-auth .sx-sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.24) 50%, transparent 62%);
    transform: translateX(-130%);
    animation: sx-sweep 7s ease-in-out 1.2s infinite;
}

/* ------------------------------------------------------- hero contents */
.sx-auth .sx-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 22px 24px 60px;
}

.sx-auth .sx-brandrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sx-auth .sx-plate {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(245, 166, 35, 0.32);
}

.sx-auth .sx-plate img {
    display: block;
    height: 42px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

/* Shown in place of the logo if the image cannot load */
.sx-auth .sx-plate-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--sx-primary);
    white-space: nowrap;
}

.sx-auth .sx-tag {
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #ffd58a;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
}

.sx-auth .sx-headline {
    margin: 22px 0 0;
    font-size: clamp(1.7rem, 6.6vw, 2rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #fff;
}

.sx-auth .sx-sub,
.sx-auth .sx-points {
    display: none;
}

/* ---------------------------------------------------------------- sheet */
.sx-auth .sx-sheet {
    position: relative;
    z-index: 3;
    margin-top: -30px;
    padding: 28px 24px 28px;
    background: #fff;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -10px 36px rgba(2, 11, 24, 0.28);
}

.sx-auth .sx-sheet-inner {
    max-width: 440px;
    margin: 0 auto;
}

.sx-auth .sx-accent {
    width: 36px;
    height: 4px;
    margin-bottom: 14px;
    background: var(--sx-amber);
    border-radius: 2px;
}

.sx-auth .sx-sheet h1 {
    margin: 0 0 6px;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--sx-ink);
}

.sx-auth .sx-lead {
    margin: 0 0 24px;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--sx-muted);
}

.sx-auth .sx-lead a {
    font-weight: 700;
    color: var(--sx-primary);
}

.sx-auth .sx-foot {
    margin: 22px 0 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
}

/* "Powered by Vibrant ERP" link to vibrantcoders.com */
.sx-auth .sx-foot a {
    font-weight: 800;
    color: var(--sx-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.sx-auth .sx-foot a:hover,
.sx-auth .sx-foot a:focus {
    color: var(--sx-primary);
    border-bottom-color: currentColor;
}

.sx-auth .sx-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sx-muted);
}

.sx-auth .sx-secure svg {
    width: 14px;
    height: 14px;
    fill: #008244;
}

/* ---------------------------------------------------------------- forms */
.sx-auth .sx-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sx-ink);
}

.sx-auth .form-control {
    height: 52px;
    padding-left: 16px;
    font-weight: 500;
    color: var(--sx-ink);
    background: var(--sx-field) !important;
    border: 1px solid var(--sx-line);
    border-radius: 14px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.sx-auth .form-control::placeholder {
    color: #94a3b8;
}

.sx-auth .form-control:focus {
    background: #fff !important;
    border-color: var(--sx-primary);
    box-shadow: 0 0 0 4px rgba(0, 93, 170, 0.14);
}

.sx-auth .input-group .form-control {
    border-right: 0;
    border-radius: 14px 0 0 14px;
}

.sx-auth .input-group .input-group-text {
    background: var(--sx-field);
    border: 1px solid var(--sx-line);
    border-left: 0;
    border-radius: 0 14px 14px 0;
    cursor: pointer;
}

.sx-auth .input-group:focus-within .input-group-text {
    border-color: var(--sx-primary);
}

.sx-auth .btn-primary {
    min-height: 54px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #fff;
    background: linear-gradient(135deg, var(--sx-primary), var(--sx-primary-2));
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 93, 170, 0.28);
    transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}

.sx-auth .btn-primary:hover,
.sx-auth .btn-primary:focus {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 93, 170, 0.34);
}

.sx-auth .btn-primary:active {
    transform: scale(0.985);
}

.sx-auth .btn-light {
    min-height: 54px;
    padding-left: 22px;
    padding-right: 22px;
    font-weight: 700;
    color: var(--sx-muted);
    background: var(--sx-field);
    border: 1px solid var(--sx-line);
    border-radius: 14px;
}

.sx-auth .link-primary {
    font-weight: 700;
    color: var(--sx-primary) !important;
}

.sx-auth .help-block {
    margin-top: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #b42318;
}

.sx-auth :focus-visible {
    outline: 3px solid rgba(0, 93, 170, 0.45);
    outline-offset: 2px;
}

/* -------------------------------------------------------------- desktop */
@media (min-width: 992px) {
    .sx-auth .sx-shell {
        grid-template-columns: minmax(0, 1.15fr) minmax(440px, 0.85fr);
    }

    .sx-auth .sx-shell {
        grid-template-rows: none;
    }

    .sx-auth .sx-hero {
        height: auto;
        min-height: 100vh;
        --sx-horizon: 40%;
    }

    .sx-auth .sx-hero-content {
        height: 100%;
        padding: 44px 56px;
    }

    .sx-auth .sx-headline,
    .sx-auth .sx-points {
        max-width: 760px;
    }

    .sx-auth .sx-plate img {
        height: 54px;
    }

    .sx-auth .sx-headline {
        margin-top: 12vh;
        font-size: clamp(2.4rem, 3.6vw, 3.6rem);
    }

    .sx-auth .sx-sub {
        display: block;
        max-width: 30ch;
        margin: 16px 0 0;
        font-size: 1.1rem;
        line-height: 1.5;
        color: rgba(255, 255, 255, 0.8);
    }

    .sx-auth .sx-points {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin: 26px 0 0;
        padding: 0;
        list-style: none;
    }

    .sx-auth .sx-points li {
        padding: 8px 14px;
        font-size: 0.85rem;
        font-weight: 600;
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        backdrop-filter: blur(4px);
    }

    .sx-auth .sx-sheet {
        display: flex;
        align-items: center;
        margin-top: 0;
        padding: 48px 56px;
        border-radius: 0;
        box-shadow: -14px 0 40px rgba(2, 11, 24, 0.22);
    }

    .sx-auth .sx-sheet-inner {
        width: 100%;
    }

    .sx-auth .sx-sheet h1 {
        font-size: 2rem;
    }
}

/* ------------------------------------------------------------- motion */
@keyframes sx-rise {
    from {
        transform: translate(-50%, 130%);
        opacity: 0.4;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes sx-sweep {
    0% {
        transform: translateX(-130%);
    }

    60%,
    100% {
        transform: translateX(130%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sx-auth .sx-sun,
    .sx-auth .sx-sweep {
        animation: none;
    }

    .sx-auth .sx-sweep {
        transform: translateX(10%);
    }

    .sx-auth .btn-primary {
        transition: none;
    }
}
