// =============================================================================
//  Authentication pages
//  Clean, enterprise-SaaS layout: navy brand rail on the left, focused form on
//  the right. Self-contained — deliberately does not pull in Bootstrap so the
//  auth screens stay light and predictable.
// =============================================================================

:root {
    --auth-primary: #1668c4;
    --auth-primary-dark: #10508f;
    --auth-primary-soft: #e8f1fb;
    --auth-accent: #22b8e6;

    --auth-navy: #0b2340;
    --auth-navy-mid: #123a63;

    --auth-ink: #0f1c2e;
    --auth-body: #4a5b70;
    --auth-muted: #7c8ca0;

    --auth-surface: #ffffff;
    --auth-canvas: #f4f7fb;
    --auth-border: #d9e1ec;
    --auth-border-strong: #c3cfdd;

    --auth-danger: #d92d20;
    --auth-success: #067647;

    --auth-radius: 10px;
    --auth-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--auth-ink);
    background: var(--auth-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

// -----------------------------------------------------------------------------
//  Shell
// -----------------------------------------------------------------------------

.auth {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;

    @media (min-width: 992px) {
        grid-template-columns: minmax(380px, 44%) 1fr;
    }
}

// --- Brand rail --------------------------------------------------------------

.auth__brand {
    position: relative;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(120% 90% at 15% 0%, rgba(34, 184, 230, 0.28) 0%, transparent 55%),
        linear-gradient(160deg, var(--auth-navy) 0%, var(--auth-navy-mid) 100%);

    @media (min-width: 992px) {
        display: flex;
    }

    // Faint dot grid for depth
    &::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
        background-size: 22px 22px;
        pointer-events: none;
    }

    > * {
        position: relative;
        z-index: 1;
    }
}

.auth__logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;

    img {
        display: block;
        max-height: 44px;
        width: auto;
    }

    span {
        font-size: 1.25rem;
        font-weight: 700;
        letter-spacing: -0.01em;
    }
}

.auth__pitch {
    max-width: 30rem;

    h1 {
        margin: 0 0 16px;
        font-size: clamp(1.75rem, 2.4vw, 2.4rem);
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }

    p {
        margin: 0;
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.72);
    }
}

.auth__points {
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;

    li {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        font-size: 0.9375rem;
        color: rgba(255, 255, 255, 0.85);
    }

    svg {
        flex: 0 0 auto;
        width: 20px;
        height: 20px;
        margin-top: 1px;
        color: var(--auth-accent);
    }
}

.auth__brand-foot {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
}

// --- Form side ---------------------------------------------------------------

.auth__main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 40px;

    @media (min-width: 992px) {
        padding: 48px;
    }
}

.auth__panel {
    width: 100%;
    max-width: 26rem;
}

// Compact brand lockup shown above the form on small screens
.auth__mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    text-decoration: none;
    color: var(--auth-ink);

    img {
        display: block;
        max-height: 40px;
        width: auto;
    }

    span {
        font-size: 1.125rem;
        font-weight: 700;
    }

    @media (min-width: 992px) {
        display: none;
    }
}

.auth__heading {
    margin-bottom: 28px;

    h2 {
        margin: 0 0 6px;
        font-size: 1.625rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: var(--auth-ink);
    }

    p {
        margin: 0;
        font-size: 0.9375rem;
        color: var(--auth-body);
    }
}

// -----------------------------------------------------------------------------
//  Form controls
// -----------------------------------------------------------------------------

.auth-form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 6px;

    > label {
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--auth-ink);
    }
}

.field__control {
    position: relative;
    display: flex;
    align-items: center;

    // Leading icon
    > svg {
        position: absolute;
        left: 13px;
        width: 18px;
        height: 18px;
        color: var(--auth-muted);
        pointer-events: none;
    }

    > svg ~ input {
        padding-left: 40px;
    }
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='tel'],
input[type='number'],
.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--auth-ink);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;

    &::placeholder {
        color: var(--auth-muted);
    }

    &:hover {
        border-color: var(--auth-border-strong);
    }

    &:focus {
        border-color: var(--auth-primary);
        box-shadow: 0 0 0 3px rgba(22, 104, 196, 0.14);
    }
}

// Reveal / hide password
.field__toggle {
    position: absolute;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--auth-muted);
    background: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;

    &:hover {
        color: var(--auth-body);
        background: var(--auth-canvas);
    }

    svg {
        width: 18px;
        height: 18px;
    }
}

.field__hint {
    font-size: 0.8125rem;
    color: var(--auth-muted);
}

// --- Checkbox ----------------------------------------------------------------

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.875rem;
    color: var(--auth-body);
    cursor: pointer;

    input[type='checkbox'] {
        flex: 0 0 auto;
        width: 17px;
        height: 17px;
        margin: 2px 0 0;
        accent-color: var(--auth-primary);
        cursor: pointer;
    }

    a {
        color: var(--auth-primary);
        font-weight: 500;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

// --- Buttons -----------------------------------------------------------------

.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    padding: 0 20px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--auth-primary);
    border: 1px solid var(--auth-primary);
    border-radius: var(--auth-radius);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;

    &:hover {
        background: var(--auth-primary-dark);
        border-color: var(--auth-primary-dark);
    }

    &:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(22, 104, 196, 0.3);
    }

    &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    &--ghost {
        color: var(--auth-body);
        background: var(--auth-surface);
        border-color: var(--auth-border);

        &:hover {
            color: var(--auth-ink);
            background: var(--auth-canvas);
            border-color: var(--auth-border-strong);
        }
    }

    &--auto {
        width: auto;
    }
}

.auth-link {
    color: var(--auth-primary);
    font-weight: 500;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

.auth__foot {
    margin-top: 24px;
    font-size: 0.9375rem;
    color: var(--auth-body);
    text-align: center;
}

.auth__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--auth-body);
    text-decoration: none;

    &:hover {
        color: var(--auth-primary);
    }

    svg {
        width: 16px;
        height: 16px;
    }
}

// -----------------------------------------------------------------------------
//  Alerts
// -----------------------------------------------------------------------------

.alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    font-size: 0.875rem;
    border: 1px solid transparent;
    border-radius: var(--auth-radius);

    svg {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        margin-top: 1px;
    }

    ul {
        margin: 4px 0 0;
        padding-left: 18px;
    }

    li + li {
        margin-top: 2px;
    }

    &--error {
        color: #7a271a;
        background: #fef3f2;
        border-color: #fecdca;

        svg {
            color: var(--auth-danger);
        }
    }

    &--success {
        color: #054f31;
        background: #ecfdf3;
        border-color: #abefc6;

        svg {
            color: var(--auth-success);
        }
    }

    &--info {
        color: #194185;
        background: var(--auth-primary-soft);
        border-color: #b2ddff;

        svg {
            color: var(--auth-primary);
        }
    }
}

.alert__title {
    font-weight: 600;
}

[x-cloak] {
    display: none !important;
}
