/* =========================
   Login Enterprise – giao diện doanh nghiệp
   Giữ bảng màu: --pref-background, --pref-button, --pref-background-primary, --pref-text
   ========================= */

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

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

body.login-page-enterprise {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    color: var(--pref-text, #1a1a1a);
}

/* =========================
   LAYOUT: split trên desktop, stack trên mobile
   ========================= */
.auth-enterprise {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    position: relative;
}

@media (min-width: 900px) {
    .auth-enterprise {
        grid-template-columns: minmax(320px, 42%) 1fr;
        grid-template-rows: 1fr;
    }
}

/* --- Brand (trái / trên) --- */
.auth-enterprise__brand {
    background: var(--pref-background, #0061B0);
    color: var(--pref-surface, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vw, 48px);
    min-height: 180px;
}

@media (min-width: 900px) {
    .auth-enterprise__brand {
        min-height: 100%;
        padding: 48px 56px;
    }
}

.auth-enterprise__brand-inner {
    text-align: center;
    max-width: 360px;
}

.auth-enterprise__logo {
    max-width: min(280px, 85vw);
    height: auto;
    display: block;
    margin: 0 auto 16px;
}

.auth-enterprise__tagline {
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.92;
    letter-spacing: 0.02em;
}

/* --- Main (phải / dưới) --- */
.auth-enterprise__main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vw, 40px) 20px;
    background: var(--pref-surface-muted, var(--pref-background-primary, #f5f5f5));
}

@media (min-width: 900px) {
    .auth-enterprise__main {
        padding: 40px;
    }
}

/* --- Card form --- */
.auth-enterprise__card {
    width: 100%;
    max-width: 400px;
    background: var(--pref-surface, #fff);
    border-radius: 16px;
    padding: 40px 32px;
    color: var(--pref-text, #1a1a1a);
}

.theme-dark .auth-enterprise__card {
    background: var(--pref-surface, #2d2d2d);
}

/* --- Header trong card --- */
.auth-enterprise__header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-enterprise__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--pref-text, #1a1a1a);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-enterprise__subtitle {
    font-size: 0.9rem;
    color: var(--pref-text-placeholder, #6b7280);
    font-weight: 400;
}

.theme-dark .auth-enterprise__subtitle {
    color: var(--pref-text-muted, #9ca3af);
}

/* --- Form --- */
.auth-enterprise__form .form-group {
    margin-bottom: 20px;
}

.auth-enterprise__form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pref-text, #374151);
    margin-bottom: 8px;
}

.auth-enterprise__form input {
    width: 100%;
    padding: 12px 14px;
    min-height: 44px;
    border: 1px solid var(--pref-border-input, #d1d5db);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--pref-surface, #fff);
    color: var(--pref-text, #1a1a1a);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.auth-enterprise__form input:hover {
    border-color: var(--pref-text-muted, #9ca3af);
}

.auth-enterprise__form input:focus {
    border-color: var(--pref-button, #00C7C8);
}

.auth-enterprise__form input::placeholder {
    color: var(--pref-text-placeholder, #9ca3af);
}

.theme-dark .auth-enterprise__form input {
    background: var(--pref-surface-alt, #374151);
    border-color: var(--pref-border-input, #4b5563);
    color: var(--pref-text, #f3f4f6);
}

.theme-dark .auth-enterprise__form input:focus {
    border-color: var(--pref-button);
}

/* --- Password policy checklist (reset password, live validation) --- */
.auth-enterprise__policy-checklist {
    margin: 4px 0 16px;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.auth-enterprise__policy-checklist script[data-password-policy-rules] {
    display: none;
}

.auth-enterprise__policy-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--pref-text-muted, #6b7280);
}

.auth-enterprise__policy-item:last-child {
    margin-bottom: 0;
}

.auth-enterprise__policy-item.is-met {
    color: var(--pref-success-fg, #15803d);
}

.auth-enterprise__policy-icon {
    flex-shrink: 0;
    width: 1.1em;
    text-align: center;
    font-weight: 600;
    line-height: inherit;
}

.auth-enterprise__policy-item.is-unmet .auth-enterprise__policy-icon::before {
    content: '✕';
    color: var(--pref-text-placeholder, #9ca3af);
}

.auth-enterprise__policy-item.is-met .auth-enterprise__policy-icon::before {
    content: '✓';
    color: var(--pref-success-fg, #15803d);
}

.auth-enterprise__policy-label {
    flex: 1;
    min-width: 0;
}

.theme-dark .auth-enterprise__policy-item.is-unmet {
    color: var(--pref-text-muted, #9ca3af);
}

.theme-dark .auth-enterprise__policy-item.is-met {
    color: var(--pref-success-fg, #4ade80);
}

.theme-dark .auth-enterprise__policy-item.is-unmet .auth-enterprise__policy-icon::before {
    color: var(--pref-text-muted, #9ca3af);
}

/* Static hints (login / fallback) */
.auth-enterprise__policy-hints {
    margin-top: 8px;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.auth-enterprise__policy-hints div + div {
    margin-top: 4px;
}

/* --- Button --- */
.auth-enterprise__btn {
    width: 100%;
    min-height: 48px;
    padding: 14px 20px;
    margin-top: 8px;
    background: var(--pref-button, #00C7C8);
    color: var(--pref-surface, #fff);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.auth-enterprise__btn:hover {
    filter: brightness(1.06);
}

.auth-enterprise__btn:active {
    transform: scale(0.99);
}

.theme-dark .auth-enterprise__btn {
    color: var(--pref-text, #1a1a1a);
}

/* --- Alerts / errors --- */
.auth-enterprise__card .error-message,
.auth-enterprise__card .alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    list-style: none;
}

.auth-enterprise__card .error-message { display: none; }
.auth-enterprise__card .error-message.show,
.auth-enterprise__card .alert.show { display: block; }
.auth-enterprise__card .alert ul { padding-left: 0; list-style: none; }

.auth-enterprise__card .error-message,
.auth-enterprise__card .alert-danger {
    background: var(--pref-danger-bg, #fef2f2);
    color: var(--pref-danger-fg, #b91c1c);
    border: 1px solid var(--pref-border-soft, #fecaca);
}

.auth-enterprise__card .alert-success {
    background: var(--pref-success-bg, #f0fdf4);
    color: var(--pref-success-fg, #15803d);
    border: 1px solid var(--pref-border-soft, #bbf7d0);
}

.auth-enterprise__card .alert-warning {
    background: var(--pref-warning-bg, #fffbeb);
    color: var(--pref-warning-fg, #b45309);
    border: 1px solid var(--pref-border-soft, #fde68a);
}

.auth-enterprise__card .error-message.show,
.auth-enterprise__card .alert.show {
    display: block;
}

/* --- Link dưới form (Forgot password) --- */
.auth-enterprise__footer-links {
    text-align: center;
    margin-top: 20px;
}

.auth-enterprise__footer-links a {
    color: var(--pref-button, #00C7C8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-enterprise__footer-links a:hover {
    text-decoration: underline;
}

/* --- Page footer: dưới cùng bên trái, 42% width (desktop) --- */
.auth-enterprise__footer {
    font-size: 0.8rem;
    padding: 14px 20px;
    text-align: center;
}

@media (min-width: 900px) {
    .auth-enterprise__footer {
        background: var(--pref-background_hover, #007BCF);
        color: var(--pref-surface, #fff);
        position: absolute;
        z-index: 1;
        bottom: 0;
        left: 0;
        width: 42%;
        padding: 14px 24px;
    }
}

@media (max-width: 899px) {
    .auth-enterprise__footer {
        background: var(--pref-background_hover, #007BCF);
        color: var(--pref-surface, #fff);
        text-align: center;
    }
}

.theme-dark .auth-enterprise__footer {
    color: var(--pref-surface, #fff);
}

/* --- OTP / bước khác (dùng chung class nếu cần) --- */
.auth-enterprise__card .form-step-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pref-text);
}

.auth-enterprise__card .input-otp {
    text-align: center !important;
    letter-spacing: 6px;
    font-size: 1.25rem !important;
}

.auth-enterprise__card .link-in-card {
    text-align: center;
    margin-top: 16px;
}

.auth-enterprise__card .link-in-card a,
.auth-enterprise__card .btn-as-link {
    color: var(--pref-button);
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-enterprise__card .btn-as-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* --- OTP: hint + resend + back button (layout theo screenshot) --- */
.auth-enterprise__otp-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.9rem;
}

.auth-enterprise__otp-hint-text {
    color: var(--pref-text-muted, #666666);
}

.auth-enterprise__otp-resend-form {
    display: inline;
}

.auth-enterprise__otp-resend-btn.btn-as-link {
    font-weight: 600;
}

.auth-enterprise__footer-actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.auth-enterprise__btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--pref-button, #00C7C8);
    background: transparent;
    color: var(--pref-button, #00C7C8);
    text-decoration: none;
    font-size: 0.95rem;
    transition: filter 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.auth-enterprise__btn-outline:hover {
    filter: brightness(0.98);
}

.auth-enterprise__btn-outline:active {
    transform: scale(0.99);
}

.theme-dark .auth-enterprise__btn-outline {
    border-color: var(--pref-button);
    color: var(--pref-button);
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 600px) {
    .auth-enterprise__card {
        padding: 28px 20px;
    }

    .auth-enterprise__title {
        font-size: 1.35rem;
    }
}

@media (max-height: 560px) {
    .auth-enterprise__brand {
        min-height: 140px;
    }

    .auth-enterprise__logo {
        max-height: 48px;
        object-fit: contain;
    }
}
