/* Mot de passe & sécurité — admin */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sec-page-body {
    background: linear-gradient(180deg, #f0f4f8 0%, #f8fafc 120px, #f1f5f9 100%);
    min-height: 100vh;
    overflow-x: clip;
}

.sec-layout {
    --sec-gutter: clamp(0.75rem, 2vw, 1.5rem);
    --sec-offset: var(--admin-main-offset, 268px);
    --sec-content-max: min(640px, 100%);
    margin-left: var(--sec-offset);
    width: calc(100% - var(--sec-offset));
    padding: 0.85rem var(--sec-gutter) 2.5rem;
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    justify-content: center;
    transition: margin-left 0.2s ease, width 0.2s ease;
}

body.sec-page-body:not(.quick-access-collapsed) .sec-layout {
    --sec-tighten: 0.75rem;
    margin-left: max(0px, calc(var(--sec-offset) - var(--sec-tighten)));
    width: calc(100% - var(--sec-offset) + var(--sec-tighten));
}

.sec-main {
    width: 100%;
    max-width: var(--sec-content-max);
    min-width: 0;
    margin: 0 auto;
}

.sec-hero {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 55%, #134e4a 100%);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    color: #fff;
    box-shadow: 0 12px 40px rgba(15, 118, 110, 0.25);
    position: relative;
    overflow: hidden;
}

.sec-hero::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.sec-hero-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
}

.sec-hero h1 {
    margin: 0 0 0.45rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
}

.sec-hero-desc {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.55;
    max-width: 36rem;
}

.sec-card {
    background: #fff;
    border-radius: 18px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 10px 28px -6px rgba(15, 23, 42, 0.1),
        0 0 0 1px rgba(148, 163, 184, 0.1);
    overflow: hidden;
}

.sec-card-accent {
    height: 0.25rem;
    background: linear-gradient(90deg, #0f766e 0%, #14b8a6 55%, #5eead4 100%);
}

.sec-card-inner {
    padding: clamp(1.15rem, 3vw, 1.65rem) clamp(1rem, 3vw, 1.5rem);
}

.sec-user-chip {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.sec-user-chip.is-visible { display: flex; }

.sec-avatar {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sec-user-meta { min-width: 0; flex: 1; }

.sec-user-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sec-user-detail {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

.sec-login-badges {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sec-login-badges.is-visible { display: flex; }

.sec-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
}

.sec-banner-slot {
    min-height: 0;
    margin-bottom: 1rem;
}

.sec-banner-slot:has(#secBanner:empty) { margin-bottom: 0; }

#secBanner:empty { display: none; }

.sec-banner {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    animation: sec-banner-in 0.25s ease;
}

@keyframes sec-banner-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.sec-banner-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.sec-banner-body { flex: 1; min-width: 0; }

.sec-banner-title {
    margin: 0 0 0.2rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.sec-banner-msg {
    margin: 0;
    opacity: 0.92;
}

.sec-banner.success {
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.sec-banner.success .sec-banner-icon {
    background: #059669;
    color: #fff;
}

.sec-banner.error {
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    color: #991b1b;
}

.sec-banner.error .sec-banner-icon {
    background: #dc2626;
    color: #fff;
}

.sec-banner.info {
    background: linear-gradient(145deg, #eff6ff 0%, #ecfeff 100%);
    border: 1px solid #bae6fd;
    color: #0c4a6e;
}

.sec-banner.info .sec-banner-icon {
    background: #0ea5e9;
    color: #fff;
}

.sec-field {
    margin-bottom: 1.1rem;
}

.sec-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}

.sec-field-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.sec-field-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.sec-field input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 1rem;
    background: #f8fafc;
    color: #0f172a;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.sec-field input::placeholder { color: #94a3b8; }

.sec-field input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.sec-field input:focus {
    outline: none;
    border-color: #0d9488;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.sec-field.has-error input {
    border-color: #f87171;
    background: #fffafb;
}

.sec-field.has-error input:focus {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

.sec-field-error {
    display: none;
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: #b91c1c;
    font-weight: 500;
}

.sec-field.has-error .sec-field-error { display: block; }

.sec-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
}

.sec-toggle-btn {
    flex: 0 0 auto;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sec-toggle-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

.sec-strength {
    margin-top: 0.45rem;
    height: 0.25rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.sec-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #0d9488);
    transition: width 0.2s ease;
}

.sec-strength-label {
    margin: 0.25rem 0 0;
    font-size: 0.72rem;
    color: #94a3b8;
}

.sec-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.35rem;
    align-items: center;
}

.sec-btn {
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: filter 0.18s ease, transform 0.12s ease;
}

.sec-btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
    min-width: 9rem;
}

.sec-btn-primary:hover:not(:disabled) { filter: brightness(1.06); }

.sec-btn-primary:active:not(:disabled) { transform: scale(0.99); }

.sec-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.sec-btn-secondary {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.sec-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.sec-footer-note {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.45;
}

@media (max-width: 768px) {
    .sec-layout {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 0.5rem;
    }

    .sec-hero {
        border-radius: 16px;
        padding: 1.35rem 1.25rem;
    }

    .sec-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sec-btn { width: 100%; }
}
