/* ============================================================
   AUTH CSS — Sani Afrique — Administration
   Mobile-first, cohérent avec styles.css (DM Sans, --primary, etc.)
   ============================================================ */

/* ---- Section Auth ---- */
.sa-auth {
    padding: 40px 0 60px;
    background: var(--bg);
}

.sa-auth-wrap {
    max-width: 420px;
    margin: 0 auto;
}

.sa-auth-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 32px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.sa-auth-head {
    text-align: center;
    margin-bottom: 24px;
}

.sa-auth-head h1 {
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
    color: var(--text);
    margin-bottom: 6px;
}

.sa-auth-head p {
    font-size: 14px;
    line-height: 22px;
    color: var(--text-2);
}

/* ---- Formulaire ---- */
.sa-auth-form .tf-field {
    display: block;
    margin-bottom: 16px;
    width: 100%;
}

.sa-auth-form .tf-field > * {
    width: 100%;
}

.sa-auth-form .tf-lable {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    color: var(--text);
    margin-bottom: 6px;
}

.sa-auth-form .sa-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    line-height: 44px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.sa-auth-form .sa-input:focus {
    border-color: var(--primary);
}

.sa-auth-form .sa-input::placeholder {
    color: var(--text-3);
}

.sa-auth-form .sa-input.is-invalid {
    border-color: var(--critical);
}

/* ---- Password field ---- */
.sa-pw-wrap {
    position: relative;
    width: 100%;
}

.sa-pw-wrap .sa-input {
    padding-right: 44px;
}

.sa-pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    transition: color 0.3s ease;
}

.sa-pw-toggle:hover {
    color: var(--text);
}

/* ---- Row (remember + forgot) ---- */
.sa-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 8px;
}

.sa-auth-row .checkbox-wrap {
    font-size: 13px;
    color: var(--text-2);
}

.sa-auth-row .checkbox-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.sa-auth-row a {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.sa-auth-row a:hover {
    text-decoration: underline;
}

/* ---- Submit ---- */
.sa-auth-form .tf-btn {
    width: 100%;
    border-radius: 4px !important;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
}

/* ---- Alerts ---- */
.sa-alert {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 20px;
    margin-bottom: 16px;
}

.sa-alert ul {
    margin: 4px 0 0 16px;
    padding: 0;
    list-style: disc;
}

.sa-alert ul li {
    margin-bottom: 2px;
}

.sa-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.sa-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ---- Back link ---- */
.sa-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.sa-back:hover {
    color: var(--primary);
}

/* ---- Security notice ---- */
.sa-security {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 18px;
}

.sa-security svg {
    flex-shrink: 0;
}

/* ---- Footer card ---- */
.sa-auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-2);
}

.sa-auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.sa-auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   HEADER — ADMIN DROPDOWN
   ============================================================ */

.header-user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.header-user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-user-info {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.header-user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.header-user-email {
    display: block;
    font-size: 11px;
    color: var(--text-2);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-menu {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.header-user-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.header-user-menu li a:hover {
    background: var(--bg);
    color: var(--primary);
}

.header-user-menu li a i {
    font-size: 16px;
    width: 18px;
    text-align: center;
    color: var(--text-2);
    transition: color 0.2s;
}

.header-user-menu li a:hover i {
    color: var(--primary);
}

.header-user-menu-divider {
    height: 1px;
    background: var(--line);
    margin: 4px 0;
}

.header-user-logout {
    color: var(--critical) !important;
}

.header-user-logout:hover {
    background: #fef2f2 !important;
}

.header-user-logout i {
    color: var(--critical) !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 576px) {
    .sa-auth {
        padding: 56px 0 80px;
    }
    .sa-auth-card {
        padding: 36px 32px;
    }
    .sa-auth-head h1 {
        font-size: 24px;
        line-height: 32px;
    }
    .sa-auth-form .sa-input {
        height: 48px;
        line-height: 48px;
    }
    .sa-pw-toggle {
        height: 48px;
    }
}

@media (min-width: 768px) {
    .sa-auth {
        padding: 64px 0 96px;
    }
    .sa-auth-wrap {
        max-width: 440px;
    }
    .sa-auth-card {
        padding: 44px 36px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }
}

@media (min-width: 992px) {
    .sa-auth {
        padding: 80px 0 120px;
    }
    .sa-auth-card {
        padding: 48px 40px;
    }
}
