/* ========================================================
   Auth CSS - TailAdmin Design System
   ======================================================== */

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

/* ---------- CSS Variables ---------- */
:root {
    --brand-50: #ecf3ff;
    --brand-100: #dde9ff;
    --brand-200: #c2d6ff;
    --brand-300: #9cb9ff;
    --brand-400: #7592ff;
    --brand-500: #465fff;
    --brand-600: #3641f5;
    --brand-950: #161950;

    --gray-50: #f9fafb;
    --gray-100: #f2f4f7;
    --gray-200: #e4e7ec;
    --gray-300: #d0d5dd;
    --gray-400: #98a2b3;
    --gray-500: #667085;
    --gray-600: #475467;
    --gray-700: #344054;
    --gray-800: #1d2939;
    --gray-900: #101828;

    --error-300: #fda29b;
    --error-500: #f04438;
    --error-50: #fef3f2;

    --success-500: #12b76a;

    --white: #ffffff;
    --radius: 0.5rem;
    --radius-lg: 0.5rem;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100% !important;
    background-color: #ffffff !important;
}

body {
    font-family: "Outfit", sans-serif;
    background-color: #ffffff !important;
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Two-Column Auth Wrapper ---------- */
.auth-page {
    height: 100vh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

/* Left: form panel */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background-color: #ffffff !important;
    height: 100%;
    overflow-y: auto;
}

.auth-form-inner {
    width: 100%;
    max-width: 440px;
}

/* Back link */
.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.15s;
    margin-bottom: 2rem;
}
.auth-back-link:hover {
    color: var(--gray-700);
}
.auth-back-link svg {
    stroke: currentColor;
}

/* Heading */
.auth-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.auth-subheading {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1.75rem;
}

/* Brand mark shown on right panel (horizontal) */
.auth-brand-logo-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
    justify-content: center;
}
.auth-brand-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.875rem;
    background-color: var(--brand-500);
    flex-shrink: 0;
}
.auth-brand-logo-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
}

/* ---------- Form Elements ---------- */
.auth-form {
    width: 100%;
}

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

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.auth-label .required {
    color: var(--error-500);
}

.auth-input-wrap {
    position: relative;
}

.auth-input {
    display: block;
    width: 100%;
    height: 2.75rem;
    padding: 0 1rem;
    font-family: "Outfit", sans-serif;
    font-size: 0.875rem;
    color: var(--gray-800);
    background-color: transparent;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
}

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

.auth-input:focus {
    border-color: var(--brand-300);
    box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.12);
}

.auth-input.has-error {
    border-color: var(--error-300);
}
.auth-input.has-error:focus {
    box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.1);
}

.auth-input:disabled {
    background-color: var(--gray-50);
    cursor: not-allowed;
    color: var(--gray-400);
}

/* Password toggle button */
.auth-pw-toggle {
    position: absolute;
    top: 50%;
    right: 0.875rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0;
    transition: color 0.15s;
    z-index: 2;
}
.auth-pw-toggle:hover {
    color: var(--gray-600);
}
.auth-pw-toggle:focus {
    outline: none;
}

.auth-input.pr-icon {
    padding-right: 2.75rem;
}

/* Error message */
.auth-error-msg {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--error-500);
    margin-top: 0.375rem;
}

/* Username badge (locked, from session) */
.auth-username-badge {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background-color: var(--brand-50, #f0fdfa);
    border: 1px solid var(--brand-200, #ccfbf1);
    border-radius: var(--radius, 0.5rem);
    margin-top: 0.25rem;
}

.auth-username-badge-icon {
    display: flex;
    align-items: center;
}

.auth-username-badge-text {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--brand-700, #0f766e);
    letter-spacing: 0.025em;
}

/* Hint text */
.auth-hint {
    font-size: 0.75rem;
    color: var(--slate-500, #64748b);
    margin-top: 0.25rem;
}

/* Session status / info alert */
.auth-alert {
    padding: 0.75rem 1rem;
    background-color: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 1.25rem;
}
.auth-alert.success {
    background-color: #ecfdf3;
    border-color: #6ce9a6;
    color: #027a48;
}

/* ---------- Submit Button ---------- */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.75rem;
    padding: 0 1.25rem;
    font-family: "Outfit", sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--white);
    background-color: var(--brand-500);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition:
        background-color 0.15s,
        box-shadow 0.15s;
    box-shadow: 0 1px 2px 0 rgba(70, 95, 255, 0.2);
    margin-top: 0.25rem;
}
.auth-btn:hover {
    background-color: var(--brand-600);
}
.auth-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.2);
}

/* ---------- Divider (Or) ---------- */
.auth-divider {
    position: relative;
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--gray-200);
}
.auth-divider span {
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
    white-space: nowrap;
}

/* ---------- Remember Me Row ---------- */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

/* ---------- Link styles ---------- */
.auth-link {
    font-size: 0.875rem;
    color: var(--brand-500);
    text-decoration: none;
    transition: color 0.15s;
}
.auth-link:hover {
    color: var(--brand-600);
}

.auth-footer-text {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ---------- Right: Brand Panel ---------- */
.auth-brand-panel {
    display: none; /* hidden on mobile */
    position: relative;
    flex: 1;
    height: 100%;
    background-color: var(--brand-950);
    overflow: hidden;
}

.auth-brand-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
    text-align: center;
}

/* Decorative grid blobs */
.auth-brand-grid-top,
.auth-brand-grid-bottom {
    position: absolute;
    width: 280px;
    opacity: 0.15;
    background-image: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.6) 1px,
        transparent 1px
    );
    background-size: 22px 22px;
}
.auth-brand-grid-top {
    top: -40px;
    right: -40px;
    height: 280px;
    border-radius: 50%;
}
.auth-brand-grid-bottom {
    bottom: -40px;
    left: -40px;
    height: 280px;
    border-radius: 50%;
}

.auth-brand-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.auth-brand-desc {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.55);
    max-width: 320px;
    line-height: 1.65;
    text-align: center;
}

/* ---------- Responsive ---------- */
@media (min-width: 1024px) {
    .auth-brand-panel {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .auth-form-panel {
        flex: 1 1 50%;
    }
    .auth-brand-panel {
        flex: 1 1 50%;
    }
}

@media (max-width: 640px) {
    .auth-heading {
        font-size: 1.375rem;
    }
    .auth-form-panel {
        padding: 2rem 1.25rem;
    }
}
