.fp-wrapper {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    padding: 40px 0 80px;
    font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
    min-height: 60vh;
}

/* اتجاه ومحاذاة حسب لغة الصفحة */
html[lang="ae"] .fp-wrapper {
    direction: rtl;
    text-align: right;
}

html[lang="en"] .fp-wrapper {
    direction: ltr;
    text-align: left;
}

.fp-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 16px;
}

.fp-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px 22px 26px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid #e5e7eb;
}

.fp-header {
    margin-bottom: 18px;
}

.fp-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 6px;
    color: #0f172a;
}

.fp-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: #6b7280;
}

/* Forms / fields */
.fp-step {
    display: none;
}

.fp-step.fp-step-active {
    display: block;
}

.fp-field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.fp-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.fp-input {
    height: 48px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0 12px;
    font-size: 15px;
    color: #111827;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Placeholder عام */
.fp-input::placeholder {
    color: #6b7280;
    opacity: 1;
    font-weight: 500;
}

/* Placeholder خطوة تغيير كلمة السر (أغمق قليلاً / مظلّل أكثر) */
#fp-new-password::placeholder,
#fp-confirm-password::placeholder {
    color: #4b5563;
    opacity: 0.35;
    font-weight: 600;
}

/* intl-tel-input داخل تصميمنا */
.iti {
    width: 100%;
}

.iti input.fp-input {
    padding-left: 50px !important;
    direction: ltr;
}

/* Password wrapper */
.fp-passwrap {
    position: relative;
}

.fp-passwrap .fp-input {
    padding-right: 40px;
}

/* زر إظهار/إخفاء كلمة المرور */
.fp-toggle-pass {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s ease;
    padding: 0;
}

.fp-toggle-pass:hover {
    background: #f9fafb;
}

.fp-toggle-pass.fp-toggle-active {
    border-color: var(--color-primary, #10b981);
    color: var(--color-primary, #10b981);
}

.fp-toggle-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.fp-toggle-icon-hide {
    display: none;
}

.fp-toggle-pass.fp-toggle-active .fp-toggle-icon-show {
    display: none;
}

.fp-toggle-pass.fp-toggle-active .fp-toggle-icon-hide {
    display: inline-flex;
}

.fp-otp-info {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.8;
    margin-bottom: 12px;
}

.fp-otp-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    direction: ltr;
    background: #f3f4ff;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid #e0e7ff;
    font-weight: 700;
    color: #111827;
    margin-top: 4px;
}

/* Single OTP input */
.fp-otp-input {
    letter-spacing: 6px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

/* placeholder للـ OTP */
.fp-otp-input::placeholder {
    color: #6b7280;
    opacity: 1;
    font-weight: 500;
}

.fp-otp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.fp-otp-timer {
    font-size: 13px;
    color: #6b7280;
}

.fp-otp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fp-otp-smallbtn {
    height: 36px;
    border-radius: 999px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 13px;
    cursor: pointer;
    color: #111827;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.fp-otp-smallbtn:disabled {
    opacity: 0.5;
    cursor: default;
}

.fp-otp-smallbtn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Buttons */
.fp-actions {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.fp-btn {
    height: 46px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.fp-btn-primary {
    background: var(--color-primary);
    color: #ffffff;
}

.fp-btn-primary:hover {
    background: var(--color-primary);
    transform: translateY(-1px);
}

.fp-btn-primary:active {
    transform: translateY(0);
}

.fp-btn-secondary {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
}

.fp-btn-secondary:hover {
    background: #f9fafb;
}

/* Alerts */
.fp-alert {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    background: #f8fafc;
    color: #111827;
    display: none;
}

.fp-alert.fp-alert-show {
    display: block;
}

.fp-alert-error {
    background: #fff5f5;
    border-color: #fecaca;
    color: #b91c1c;
}

.fp-alert-success {
    background: #f1fff2;
    border-color: #bbf7d0;
    color: #166534;
}

.fp-alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.fp-field.error .fp-input {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12) !important;
}

.fp-error-msg {
    font-size: 12px;
    color: #b91c1c;
}

/* Responsive */
@media (max-width: 575.98px) {
    .fp-card {
        padding: 20px 16px 22px;
        border-radius: 16px;
    }

    .fp-title {
        font-size: 18px;
    }
}


/* =========================================================
   FP Dark Mode (body.dark-mode) — Overrides فقط
   ========================================================= */
body.dark-mode .fp-wrapper {
    background: linear-gradient(135deg, #3e3e3e 0%, #2f2f2f 100%);
    color: #f1f1f1;
}

body.dark-mode .fp-card {
    background: #181818;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

body.dark-mode .fp-title {
    color: #ffffff;
}

body.dark-mode .fp-subtitle,
body.dark-mode .fp-label,
body.dark-mode .fp-otp-info,
body.dark-mode .fp-otp-timer {
    color: rgba(255, 255, 255, 0.72);
}

/* Inputs */
body.dark-mode .fp-input {
    background: #222;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

body.dark-mode .fp-input:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.28);
}

/* Placeholders */
body.dark-mode .fp-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    opacity: 1;
    font-weight: 500;
}

body.dark-mode #fp-new-password::placeholder,
body.dark-mode #fp-confirm-password::placeholder {
    color: rgba(255, 255, 255, 0.55);
    opacity: 0.35;
    font-weight: 600;
}

body.dark-mode .fp-otp-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    opacity: 1;
    font-weight: 500;
}

/* Toggle password button */
body.dark-mode .fp-toggle-pass {
    background: #222;
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .fp-toggle-pass:hover {
    background: #2a2a2a;
}

body.dark-mode .fp-toggle-pass.fp-toggle-active {
    border-color: var(--color-primary, #10b981);
    color: var(--color-primary, #10b981);
}

/* OTP phone pill */
body.dark-mode .fp-otp-phone {
    background: rgba(33, 150, 243, 0.22);
    border-color: rgba(33, 150, 243, 0.38);
    color: #ffffff;
}

/* Small buttons */
body.dark-mode .fp-otp-smallbtn {
    background: #222;
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

body.dark-mode .fp-otp-smallbtn:hover:not(:disabled) {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.24);
}

/* Secondary button */
body.dark-mode .fp-btn-secondary {
    background: #222;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

body.dark-mode .fp-btn-secondary:hover {
    background: #2a2a2a;
}

/* Alerts */
body.dark-mode .fp-alert {
    background: #222;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

body.dark-mode .fp-alert-error {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ffe4e6;
}

body.dark-mode .fp-alert-success {
    background: rgba(16, 185, 129, 0.28);
    border-color: rgba(16, 185, 129, 0.45);
    color: #dcfce7;
}

body.dark-mode .fp-alert-info {
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(59, 130, 246, 0.45);
    color: #dbeafe;
}

/* Field error */
body.dark-mode .fp-field.error .fp-input {
    border-color: rgba(239, 68, 68, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

body.dark-mode .fp-error-msg {
    color: #fecaca;
}

/* intl-tel-input fullscreen list */
body.dark-mode .iti--fullscreen-popup .iti__country-list {
    background: #181818;
    color: #ffffff;
}

body.dark-mode .iti__country:hover,
body.dark-mode .iti__country.iti__highlight {
    background: #2a2a2a;
}
