/* =========================================================
   DOC MARLY SMART QUEUEING MANAGEMENT SYSTEM
   Authentication
   ========================================================= */


/* =========================================================
   Brand Tokens
   ========================================================= */

:root {
    --brand-primary: #242364;
    --brand-primary-hover: #1d1c55;

    --brand-danger: #e30b21;
    --brand-accent: #ffde00;

    --canvas: #f8fafc;
    --surface: #ffffff;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-900: #0f172a;
}


/* =========================================================
   Base
   ========================================================= */

* {
    box-sizing: border-box;
}


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


body {
    margin: 0;

    color: var(--slate-900);

    background: var(--surface);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


button,
input {
    font: inherit;
}


/* =========================================================
   Page
   ========================================================= */

.auth-page {
    width: 100%;
    min-height: 100vh;

    background: var(--surface);

    overflow: hidden;
}


/* =========================================================
   LEFT PANEL
   ========================================================= */

.auth-form-panel {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;

    padding: 3rem 4rem;

    background: var(--surface);
}


.auth-form-container {
    width: min(100%, 430px);

    position: relative;
    z-index: 1;
}


.auth-motion-dots {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    opacity: 0.42;
    pointer-events: none;
}


.auth-motion-dots::before,
.auth-motion-dots::after {
    content: "";
    position: absolute;
    width: 26rem;
    height: 26rem;
    border-radius: 50%;
    background-image: radial-gradient(circle, rgba(36, 35, 100, 0.2) 0 1.5px, transparent 1.7px);
    background-size: 18px 18px;
    mask-image: radial-gradient(ellipse, #000 0%, transparent 68%);
    -webkit-mask-image: radial-gradient(ellipse, #000 0%, transparent 68%);
}


.auth-motion-dots::before {
    top: -5rem;
    right: -3rem;
    animation: auth-dots-drift-one 13s ease-in-out infinite alternate;
}


.auth-motion-dots::after {
    bottom: -5rem;
    left: -4rem;
    background-image: radial-gradient(circle, rgba(227, 11, 33, 0.16) 0 1.5px, transparent 1.7px);
    background-size: 22px 22px;
    animation: auth-dots-drift-two 16s ease-in-out infinite alternate;
}


@keyframes auth-dots-drift-one {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); background-position: 0 0; }
    50% { transform: translate3d(-5rem, 3rem, 0) rotate(10deg); background-position: 36px 24px; }
    100% { transform: translate3d(4rem, 7rem, 0) rotate(-7deg); background-position: -28px 54px; }
}


@keyframes auth-dots-drift-two {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); background-position: 0 0; }
    50% { transform: translate3d(6rem, -4rem, 0) rotate(-11deg); background-position: -44px 30px; }
    100% { transform: translate3d(-3rem, -8rem, 0) rotate(8deg); background-position: 34px -48px; }
}


/* =========================================================
   Government Header
   ========================================================= */

.auth-government-header {
    display: flex;
    align-items: center;

    gap: 0.9rem;

    margin-bottom: 3.75rem;
}


.auth-government-seal {
    display: block;

    width: 58px;
    height: 58px;

    flex-shrink: 0;

    object-fit: contain;

    border-radius: 50%;
}


.auth-government-text {
    min-width: 0;

    display: flex;
    flex-direction: column;

    line-height: 1.25;
}


.auth-government-label {
    margin-bottom: 0.15rem;

    color: var(--slate-500);

    font-size: 0.67rem;
    font-weight: 700;

    letter-spacing: 0.075em;

    text-transform: uppercase;
}


.auth-government-name {
    color: var(--brand-primary);

    font-size: 0.94rem;
    font-weight: 750;

    letter-spacing: -0.01em;
}


.auth-government-district {
    margin-top: 0.15rem;

    color: var(--slate-500);

    font-size: 0.72rem;
    font-weight: 500;
}


/* =========================================================
   Login Heading
   ========================================================= */

.auth-heading {
    margin-bottom: 2rem;
}


.auth-heading-accent {
    display: block;

    width: 32px;
    height: 3px;

    margin-bottom: 1rem;

    border-radius: 999px;

    background: var(--brand-accent);
}


.auth-eyebrow {
    margin: 0 0 0.45rem;

    color: var(--brand-primary);

    font-size: 0.72rem;
    font-weight: 750;

    letter-spacing: 0.09em;

    text-transform: uppercase;
}


.auth-heading h1 {
    margin: 0;

    color: var(--slate-900);

    font-size: clamp(1.8rem, 3vw, 2.15rem);
    font-weight: 650;

    line-height: 1.18;

    letter-spacing: -0.035em;
}


.auth-heading-description {
    max-width: 390px;

    margin: 0.7rem 0 0;

    color: var(--slate-500);

    font-size: 0.9rem;

    line-height: 1.6;
}


/* =========================================================
   Form
   ========================================================= */

.auth-form-group {
    margin-bottom: 1.35rem;
}


.form-label {
    margin-bottom: 0.5rem;

    color: var(--slate-700);

    font-size: 0.84rem;
    font-weight: 600;
}


/* =========================================================
   Inputs
   ========================================================= */

.auth-input {
    min-height: 49px;

    padding: 0.72rem 0.9rem;

    color: var(--slate-900);

    background: var(--surface);

    border: 1px solid var(--slate-300);

    border-radius: 0.625rem;

    box-shadow: none;

    font-size: 0.9rem;

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background-color 150ms ease;
}


.auth-input::placeholder {
    color: var(--slate-400);
}


.auth-input:hover {
    border-color: var(--slate-400);
}


.auth-input:focus {
    color: var(--slate-900);

    background: var(--surface);

    border-color: var(--brand-primary);

    outline: none;

    box-shadow:
        0 0 0 3px rgba(255, 222, 0, 0.25);
}


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

    background-image: none;
}


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

    box-shadow:
        0 0 0 3px rgba(227, 11, 33, 0.12);
}


/* =========================================================
   Validation
   ========================================================= */

.auth-field-error {
    margin-top: 0.4rem;

    color: var(--brand-danger);

    font-size: 0.77rem;
    font-weight: 500;

    line-height: 1.4;
}


/* =========================================================
   Password Field
   ========================================================= */

.auth-password-field {
    position: relative;
}


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


/*
 * Icon button
 */

.auth-password-toggle {
    position: absolute;

    z-index: 5;

    top: 50%;
    right: 0.55rem;

    transform: translateY(-50%);

    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: var(--slate-500);

    background: transparent;

    border: 0;

    border-radius: 0.45rem;

    cursor: pointer;

    line-height: 1;

    transition:
        color 150ms ease,
        background-color 150ms ease,
        box-shadow 150ms ease;
}


.auth-password-toggle:hover {
    color: var(--brand-primary);

    background: var(--slate-50);
}


.auth-password-toggle:focus {
    color: var(--brand-primary);

    outline: none;
}


.auth-password-toggle:focus-visible {
    color: var(--brand-primary);

    outline: none;

    box-shadow:
        0 0 0 2px var(--brand-accent);
}


/*
 * Inline Bootstrap Icon SVG
 */

.auth-password-icon {
    display: block;

    width: 18px;
    height: 18px;

    flex-shrink: 0;

    color: currentColor;

    fill: currentColor;

    pointer-events: none;
}


.auth-password-icon[hidden] {
    display: none !important;
}


/* =========================================================
   Remember Me
   ========================================================= */

.auth-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 0.1rem;
    margin-bottom: 1.5rem;
}


.form-check {
    min-height: auto;
}


.form-check-input {
    margin-top: 0.18rem;

    border-color: var(--slate-300);

    cursor: pointer;
}


.form-check-input:checked {
    background-color: var(--brand-primary);

    border-color: var(--brand-primary);
}


.form-check-input:focus {
    border-color: var(--brand-primary);

    box-shadow:
        0 0 0 3px rgba(255, 222, 0, 0.25);
}


.form-check-label {
    color: var(--slate-500);

    font-size: 0.82rem;

    cursor: pointer;
}


/* =========================================================
   Submit Button
   ========================================================= */

.auth-submit-btn {
    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 0.55rem;

    color: #ffffff;

    background: var(--brand-primary);

    border: 1px solid var(--brand-primary);

    border-radius: 0.625rem;

    box-shadow: none;

    font-size: 0.9rem;
    font-weight: 650;

    transition:
        background-color 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 100ms ease;
}


.auth-submit-btn:hover {
    color: #ffffff;

    background: var(--brand-primary-hover);

    border-color: var(--brand-primary-hover);
}


.auth-submit-btn:focus {
    color: #ffffff;

    background: var(--brand-primary-hover);

    border-color: var(--brand-primary-hover);
}


.auth-submit-btn:focus-visible {
    box-shadow:
        0 0 0 3px rgba(255, 222, 0, 0.4);
}


.auth-submit-btn:active {
    transform: translateY(1px);
}


.auth-submit-btn:disabled {
    color: #ffffff;

    background: var(--brand-primary);

    border-color: var(--brand-primary);

    opacity: 0.7;

    cursor: wait;
}


/* =========================================================
   Error Alert
   ========================================================= */

.auth-alert {
    margin-bottom: 1.5rem;

    padding: 0.85rem 1rem;

    color: #991b1b;

    background: #fffafa;

    border:
        1px solid
        rgba(227, 11, 33, 0.2);

    border-radius: 0.625rem;

    font-size: 0.81rem;

    line-height: 1.5;
}


.auth-alert strong {
    display: block;

    margin-bottom: 0.15rem;

    color: #7f1d1d;

    font-weight: 700;
}


.auth-alert span {
    display: block;
}


.auth-alert--success {
    color: #166534;
    background: #f0fdf4;
    border-color: rgba(22, 101, 52, 0.2);
}


.auth-alert--success strong {
    color: #14532d;
}

.auth-otp-form {
    display: grid;
    gap: 0.75rem;
}

.auth-otp-form label {
    color: var(--slate-900);
    font-size: 0.8rem;
    font-weight: 700;
}

.auth-otp-input {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-align: center;
}

.auth-otp-help {
    color: var(--slate-500);
    font-size: 0.72rem;
}


/* =========================================================
   Footer
   ========================================================= */

.auth-footer {
    margin-top: 3.25rem;

    padding-top: 1.25rem;

    border-top:
        1px solid
        var(--slate-100);

    text-align: center;
}


.auth-footer p {
    margin: 0;

    color: var(--slate-600);

    font-size: 0.74rem;
    font-weight: 550;
}


.auth-footer span {
    display: block;

    margin-top: 0.2rem;

    color: var(--slate-400);

    font-size: 0.68rem;
}


/* =========================================================
   RIGHT IMAGE PANEL
   ========================================================= */

.auth-image-panel {
    position: relative;

    min-height: 100vh;

    overflow: hidden;

    background: #eef4fa;
}


.auth-cover-image {
    position: absolute;

    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center center;
}


/* Subtle divider */

.auth-image-panel::before {
    content: "";

    position: absolute;

    z-index: 2;

    top: 0;
    bottom: 0;
    left: 0;

    width: 1px;

    background:
        rgba(226, 232, 240, 0.9);

    pointer-events: none;
}


/* =========================================================
   Large Desktop
   ========================================================= */

@media (min-width: 1400px) {

    .auth-form-panel {
        padding-left: 5rem;
        padding-right: 5rem;
    }


    .auth-form-container {
        width: min(100%, 440px);
    }

}


/* =========================================================
   Medium Desktop
   ========================================================= */

@media (min-width: 992px) and (max-width: 1199.98px) {

    .auth-form-panel {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }


    .auth-government-header {
        margin-bottom: 3rem;
    }


    .auth-government-seal {
        width: 52px;
        height: 52px;
    }


    .auth-government-name {
        font-size: 0.87rem;
    }

}


/* =========================================================
   Tablet / Mobile
   ========================================================= */

@media (max-width: 991.98px) {

    .auth-page {
        background: var(--canvas);
    }


    .auth-form-panel {
        min-height: 100vh;

        padding:
            max(2rem, env(safe-area-inset-top))
            1.5rem
            max(2rem, env(safe-area-inset-bottom));

        background: var(--surface);
    }


    .auth-form-container {
        width: min(100%, 450px);
    }


    .auth-government-header {
        margin-bottom: 3.25rem;
    }

}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 575.98px) {

    .auth-form-panel {
        align-items: flex-start;

        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }


    .auth-government-header {
        gap: 0.75rem;

        margin-bottom: 2.75rem;
    }


    .auth-government-seal {
        width: 48px;
        height: 48px;
    }


    .auth-government-label {
        font-size: 0.6rem;
    }


    .auth-government-name {
        font-size: 0.82rem;
    }


    .auth-government-district {
        font-size: 0.65rem;
    }


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


    .auth-heading h1 {
        font-size: 1.65rem;
    }


    .auth-heading-description {
        font-size: 0.85rem;
    }


    .auth-footer {
        margin-top: 2.75rem;
    }

}


/* =========================================================
   Short Desktop
   ========================================================= */

@media (min-width: 992px) and (max-height: 760px) {

    .auth-form-panel {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }


    .auth-government-header {
        margin-bottom: 2rem;
    }


    .auth-government-seal {
        width: 48px;
        height: 48px;
    }


    .auth-heading {
        margin-bottom: 1.4rem;
    }


    .auth-heading-description {
        margin-top: 0.5rem;
    }


    .auth-form-group {
        margin-bottom: 1rem;
    }


    .auth-form-options {
        margin-bottom: 1.1rem;
    }


    .auth-footer {
        margin-top: 1.75rem;
    }

}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

}
