/* ===================================================================
   TopFact Auth Page Styles – Split-panel layout
   =================================================================== */

:root {
    --tf-blue: #3b7ea6;
    --tf-blue-dark: #2c6080;
    --tf-green: #7aaa1a;
    --tf-dark: #0f1923;
    --tf-dark-2: #1a2733;
    --white: #ffffff;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    --bg-primary: var(--white);
    --border-light: var(--gray-200);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* ============================================================
   Base
   ============================================================ */

.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    display: flex;
}

/* ============================================================
   Split layout
   ============================================================ */

.auth-split {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ---- Brand panel (left) ---- */

.auth-brand {
    flex: 1;
    background: var(--tf-dark);
    background-image:
        radial-gradient(ellipse at 15% 55%, rgba(59,126,166,.18) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(122,170,26,.10) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.auth-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.auth-brand__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.auth-brand__logo-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--tf-blue), var(--tf-green));
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.auth-brand__logo-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
}

.auth-brand__content {
    position: relative;
    z-index: 1;
}

.auth-brand__heading {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0 0 16px;
    color: var(--white);
}

.auth-brand__heading em {
    font-style: normal;
    background: linear-gradient(120deg, var(--tf-blue) 0%, var(--tf-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand__desc {
    font-size: 0.9375rem;
    color: rgba(255,255,255,.5);
    line-height: 1.65;
    max-width: 340px;
    margin: 0;
}

.auth-brand__features {
    display: flex;
    flex-direction: column;
    gap: 11px;
    position: relative;
    z-index: 1;
}

.auth-brand__feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: rgba(255,255,255,.55);
}

.auth-brand__feature-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tf-blue);
    flex-shrink: 0;
}

/* ---- Form panel (right) ---- */

.auth-form-panel {
    width: 520px;
    flex-shrink: 0;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 48px;
    border-left: 1px solid var(--border-light);
}

.auth-form__header {
    margin-bottom: 32px;
}

.auth-form__title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.auth-form__subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ---- Error box ---- */

.auth-form__error-box {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 22px;
}

.auth-form__error-box.is-visible {
    display: block;
}

.auth-form__error-box ul {
    margin: 0;
    padding: 0 0 0 16px;
    font-size: 0.875rem;
    color: #b91c1c;
}

/* ---- Form ---- */

.auth-form__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---- Fields ---- */

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.auth-field__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-field__input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-field__input::placeholder {
    color: var(--text-muted);
}

.auth-field__input:hover {
    border-color: var(--gray-300);
    background: var(--white);
}

.auth-field__input:focus {
    border-color: var(--tf-blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(59,126,166,.12);
}

.auth-field__pw-wrap {
    position: relative;
}

.auth-field__pw-wrap .auth-field__input {
    padding-right: 48px;
}

.auth-field__pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--gray-400);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.auth-field__pw-toggle:hover {
    color: var(--text-secondary);
    background: var(--gray-100);
}

.auth-field__pw-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-field__validation {
    font-size: 0.8125rem;
    color: #dc2626;
    min-height: 1em;
}

.auth-field__help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* ---- Remember me row ---- */

.auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -4px;
}

.auth-form__checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.auth-form__checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--tf-blue);
    cursor: pointer;
}

/* ---- Submit button ---- */

.auth-form__submit {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    background: var(--tf-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-form__submit:hover {
    background: var(--gray-800);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15,25,35,.22);
}

.auth-form__submit:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ---- Social / SSO divider ---- */

.auth-form__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.auth-form__divider::before,
.auth-form__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ---- Microsoft Entra login button ---- */

.auth-form__entra-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
    padding: 11px 16px;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-form__entra-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    color: var(--gray-800);
    text-decoration: none;
}

.auth-form__entra-btn:active {
    background: var(--gray-100);
    box-shadow: none;
}

/* ---- Footer ---- */

.auth-form__footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
}

.auth-form__footer a {
    color: var(--tf-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-form__footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
    .auth-brand {
        padding: 40px 36px;
    }

    .auth-brand__heading {
        font-size: 2rem;
    }

    .auth-form-panel {
        width: 420px;
        padding: 48px 36px;
    }
}

@media (max-width: 680px) {
    .auth-brand {
        display: none;
    }

    .auth-split {
        justify-content: center;
        align-items: flex-start;
        background: var(--gray-50);
    }

    .auth-form-panel {
        width: 100%;
        max-width: 480px;
        padding: 48px 28px;
        border-left: none;
        justify-content: flex-start;
        padding-top: 64px;
    }
}

@media (max-width: 400px) {
    .auth-form-panel {
        padding: 40px 20px;
    }
}
