/* ─── Pawa Form Ministry — Login : CSS ───────────────────────────────────── */

/* ── Centering wrapper ──────────────────────────────────────────────────── */
.pfml-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    font-family: 'Raleway', sans-serif;
    box-sizing: border-box;
}

/* ── Carte principale ───────────────────────────────────────────────────── */
.pfml-card {
    width: 100%;
    max-width: 420px;
    background: rgba(17, 13, 46, 0.82);
    border: 1px solid rgba(201, 162, 39, 0.22);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(201, 162, 39, 0.08),
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 80px rgba(59, 31, 140, 0.25);
    backdrop-filter: blur(16px);
    animation: pfml-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pfml-rise {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── En-tête ────────────────────────────────────────────────────────────── */
.pfml-card-header {
    text-align: center;
    padding: 36px 32px 24px;
    border-bottom: 1px solid rgba(201, 162, 39, 0.1);
    background: linear-gradient(180deg,
        rgba(59, 31, 140, 0.5) 0%,
        transparent 100%);
}

.pfml-logo {
    max-height: 64px;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 14px;
}

.pfml-logo-icon {
    font-size: 38px;
    color: var(--sacred-gold, #c9a227);
    text-shadow: 0 0 20px rgba(201, 162, 39, 0.5);
    margin-bottom: 10px;
    line-height: 1;
    animation: pfml-glow 3s ease-in-out infinite;
}

@keyframes pfml-glow {
    0%, 100% { text-shadow: 0 0 16px rgba(201,162,39,.35); }
    50%       { text-shadow: 0 0 32px rgba(201,162,39,.7); }
}

.pfml-title {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--sacred-gold, #c9a227);
    margin: 0 0 6px;
    letter-spacing: 0.05em;
}

.pfml-subtitle {
    font-size: 13px;
    color: rgba(248, 244, 232, 0.5);
    margin: 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Formulaire ─────────────────────────────────────────────────────────── */
.pfml-form {
    padding: 28px 32px 20px;
}

.pfml-field {
    margin-bottom: 20px;
}

.pfml-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(248, 244, 232, 0.65);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ── Input ──────────────────────────────────────────────────────────────── */
.pfml-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pfml-input-icon {
    position: absolute;
    left: 14px;
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
}

.pfml-input {
    width: 100%;
    background: rgba(59, 31, 140, 0.28);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 10px;
    color: var(--sacred-ivory, #f8f4e8);
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    padding: 12px 44px 12px 42px;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.pfml-input:focus {
    border-color: rgba(201, 162, 39, 0.55);
    background: rgba(59, 31, 140, 0.45);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

.pfml-input::placeholder {
    color: rgba(248, 244, 232, 0.28);
}

.pfml-input.pfml-input-error {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Toggle password visibility */
.pfml-toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
    line-height: 1;
}
.pfml-toggle-pw:hover { opacity: 0.9; }

/* ── Checkbox souvenir ───────────────────────────────────────────────────── */
.pfml-remember {
    margin-bottom: 22px;
}

.pfml-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(248, 244, 232, 0.6);
    user-select: none;
}

.pfml-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #c9a227;
    cursor: pointer;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.pfml-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 10px;
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 13px 28px;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.pfml-btn:active { transform: scale(0.97); }

.pfml-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #c9a227 0%, #f0d060 50%, #c9a227 100%);
    background-size: 200% 100%;
    color: #1a0e4a;
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.35);
}

.pfml-btn-primary:hover:not(:disabled) {
    background-position: 100% 0;
    box-shadow: 0 6px 28px rgba(201, 162, 39, 0.5);
    transform: translateY(-1px);
}

.pfml-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pfml-btn-full { width: 100%; }

/* Bouton lien */
.pfml-link-btn {
    background: none;
    border: none;
    color: rgba(201, 162, 39, 0.7);
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color 0.2s, text-decoration-color 0.2s;
}
.pfml-link-btn:hover {
    color: var(--sacred-gold, #c9a227);
    text-decoration-color: currentColor;
}

/* ── Messages ────────────────────────────────────────────────────────────── */
.pfml-msg {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.pfml-msg.pfml-msg-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.pfml-msg.pfml-msg-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.pfml-msg.pfml-msg-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* ── Footer de la carte ──────────────────────────────────────────────────── */
.pfml-card-footer {
    text-align: center;
    padding: 14px 32px 28px;
}

/* ── Overlay popup ───────────────────────────────────────────────────────── */
.pfml-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(4, 2, 18, 0.75);
    backdrop-filter: blur(6px);
    animation: pfml-overlay-in 0.25s ease both;
}

@keyframes pfml-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Popup ───────────────────────────────────────────────────────────────── */
.pfml-popup {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(13, 10, 26, 0.96);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 20px;
    padding: 36px 32px 32px;
    box-shadow:
        0 0 0 1px rgba(201, 162, 39, 0.1),
        0 32px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(59, 31, 140, 0.3);
    animation: pfml-popup-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pfml-popup-in {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pfml-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    color: rgba(248, 244, 232, 0.6);
    font-size: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}
.pfml-popup-close:hover {
    background: rgba(255,255,255,0.14);
    color: var(--sacred-ivory, #f8f4e8);
}

.pfml-step-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 16px;
    line-height: 1;
}

.pfml-success-icon {
    animation: pfml-bounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes pfml-bounce {
    0%, 100% { transform: scale(1); }
    30%       { transform: scale(1.25); }
    60%       { transform: scale(0.9); }
    80%       { transform: scale(1.08); }
}

.pfml-popup-title {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--sacred-gold, #c9a227);
    text-align: center;
    margin: 0 0 10px;
}

.pfml-popup-desc {
    font-size: 13px;
    color: rgba(248, 244, 232, 0.6);
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ── OTP inputs ─────────────────────────────────────────────────────────── */
.pfml-otp-wrap {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
}

.pfml-otp-input {
    width: 46px;
    height: 54px;
    background: rgba(59, 31, 140, 0.35);
    border: 2px solid rgba(201, 162, 39, 0.25);
    border-radius: 10px;
    color: var(--sacred-gold, #c9a227);
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: 'Courier New', monospace;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
}

.pfml-otp-input:focus {
    border-color: var(--sacred-gold, #c9a227);
    background: rgba(59, 31, 140, 0.55);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.pfml-otp-input.filled {
    border-color: rgba(201, 162, 39, 0.55);
    background: rgba(59, 31, 140, 0.5);
}

/* Timer OTP */
.pfml-otp-timer {
    text-align: center;
    font-size: 12px;
    color: rgba(248, 244, 232, 0.45);
    margin-bottom: 18px;
}

#pfml-timer {
    font-weight: 700;
    color: rgba(201, 162, 39, 0.7);
}

#pfml-timer.pfml-timer-urgent {
    color: #fca5a5;
    animation: pfml-blink 1s step-end infinite;
}

@keyframes pfml-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.pfml-resend-btn {
    display: block;
    width: 100%;
    text-align: center;
}

/* ── Indicateur force du mot de passe ───────────────────────────────────── */
.pfml-strength-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.pfml-strength-bar {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    overflow: hidden;
}

.pfml-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width 0.35s, background-color 0.35s;
}

.pfml-strength-label {
    font-size: 11px;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
    color: rgba(248,244,232,0.5);
    transition: color 0.2s;
}

/* ── Loader dots ─────────────────────────────────────────────────────────── */
.pfml-loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pfml-loader-dots span {
    width: 8px;
    height: 8px;
    background: var(--sacred-gold, #c9a227);
    border-radius: 50%;
    animation: pfml-dot 1.2s infinite ease-in-out;
    opacity: 0.3;
}

.pfml-loader-dots span:nth-child(1) { animation-delay: 0s; }
.pfml-loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.pfml-loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pfml-dot {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.3); }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .pfml-card {
        border-radius: 16px;
    }
    .pfml-form,
    .pfml-card-header,
    .pfml-card-footer,
    .pfml-popup {
        padding-left: 20px;
        padding-right: 20px;
    }
    .pfml-otp-input {
        width: 38px;
        height: 46px;
        font-size: 20px;
    }
    .pfml-otp-wrap {
        gap: 6px;
    }
}
