/**
 * نافذة ربط الجوال في الملف الشخصي — أنماط خاصة بالمودال فقط
 */

.phone-modal-dialog {
    max-width: 420px;
}

.phone-modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(1, 48, 95, 0.2);
    overflow: hidden;
}

.phone-modal-hero {
    background: linear-gradient(145deg, #01305F 0%, #0089BF 100%);
    padding: 1.75rem 1.25rem 1.35rem;
    text-align: center;
    color: #fff;
    position: relative;
}

.phone-modal-hero::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    top: -90px;
    inset-inline-end: -40px;
    pointer-events: none;
}

.phone-modal-close {
    position: absolute;
    inset-inline-end: 14px;
    inset-block-start: 14px;
    z-index: 2;
    opacity: 0.9;
    filter: brightness(0) invert(1);
}

.phone-modal-hero-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.75rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.phone-modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    color: #fff;
}

.phone-modal-subtitle {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.phone-link-steps {
    position: relative;
    width: 200px;
    margin: 0.25rem auto 0;
    padding: 0 0.5rem;
}

.phone-link-steps-track {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    list-style: none;
    margin: 0;
    padding: 0;
}

.phone-link-steps-line {
    position: absolute;
    top: 17px;
    inset-inline: 18%;
    height: 3px;
    width: 44%;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    z-index: 0;
    overflow: hidden;
}

.phone-link-steps-line-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.85) 100%);
    border-radius: 999px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-link-steps.is-step-2 .phone-link-steps-line-fill {
    width: 100%;
}

.phone-link-step-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    position: relative;
    z-index: 1;
}

.phone-link-step-marker {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.phone-link-step-num {
    font-size: 0.8125rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1;
}

.phone-link-step-check {
    display: none;
    font-size: 1.05rem;
    color: #0089BF;
    line-height: 1;
}

.phone-link-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.phone-link-step-item.active .phone-link-step-marker {
    border-color: #fff;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.phone-link-step-item.active .phone-link-step-num {
    color: #01305F;
}

.phone-link-step-item.active .phone-link-step-label {
    color: #fff;
    font-weight: 700;
}

.phone-link-step-item.completed .phone-link-step-marker {
    border-color: #fff;
    background: #fff;
}

.phone-link-step-item.completed .phone-link-step-num {
    display: none;
}

.phone-link-step-item.completed .phone-link-step-check {
    display: block;
}

.phone-link-step-item.completed .phone-link-step-label {
    color: rgba(255, 255, 255, 0.9);
}

.phone-modal-body {
    padding: 1.35rem 1.25rem 1.5rem !important;
    background: #fff;
}

.phone-modal-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #01305F;
    margin-bottom: 0.5rem;
}

.phone-link-hint {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.5;
    border: 1px solid #e2e8f0;
}

.phone-link-hint .bi-whatsapp {
    color: #25D366;
    font-size: 1.25rem;
}

.phone-modal-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    background: #fef2f2;
    border-radius: 10px;
    color: #b91c1c;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.phone-modal-error:not(.d-none)::before {
    content: '\F333';
    font-family: bootstrap-icons;
    flex-shrink: 0;
}

.btn-profile-gradient {
    width: 100%;
    padding: 0.8rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #01305F 0%, #0089BF 100%);
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-profile-gradient:hover:not(:disabled) {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(1, 48, 95, 0.28);
}

.btn-profile-gradient:disabled {
    opacity: 0.65;
}

.phone-modal-cancel {
    border-radius: 12px;
    font-weight: 600;
    border-color: #e2e8f0;
    color: #64748b;
}

.phone-otp-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.15rem;
    margin-bottom: 1rem;
}

.phone-otp-sent-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #047857;
    margin-bottom: 0.75rem;
}

.phone-otp-sent-banner i {
    color: #10b981;
    font-size: 1.125rem;
}

.phone-otp-input-wrap {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    padding: 0.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-otp-input-wrap:focus-within {
    border-color: #0089BF;
    box-shadow: 0 0 0 4px rgba(0, 137, 191, 0.1);
}

.phone-otp-input-wrap.is-invalid {
    border-color: #ef4444;
}

.phone-modal-content .otp-input {
    border: none !important;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.65rem;
    height: 56px;
    text-align: center;
    color: #01305F;
    background: transparent;
    padding-inline-start: 0.65rem;
}

.phone-modal-content .otp-input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.phone-otp-input-wrap .form-control:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.phone-change-number {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0089BF;
    text-decoration: none;
}

.phone-change-number:hover {
    color: #01305F;
}

.phone-otp-success-panel {
    text-align: center;
    padding: 2rem 0.5rem;
}

.phone-otp-success-panel i {
    font-size: 4rem;
    color: #10b981;
}

.phone-modal-content .email-code-input {
    text-transform: uppercase;
    letter-spacing: 0.55rem;
    padding-inline-start: 0.45rem;
    border: none !important;
}

.phone-modal-content .email-code-input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

#phoneOtpTimer,
#otpTimer,
#emailTimer {
    font-size: 0.8125rem;
    color: #94a3b8;
}

/* حقول كلمة المرور — الملف الشخصي والتسجيل */
.password-field-wrap {
    position: relative;
    margin-bottom: 0.85rem;
}

.password-field-wrap .form-control {
    padding-inline-end: 2.85rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-size: 0.875rem;
}

.password-field-wrap .form-control:focus {
    border-color: #0089BF;
    box-shadow: 0 0 0 4px rgba(0, 137, 191, 0.1);
}

.password-field-wrap .form-control.is-invalid {
    border-color: #ef4444;
}

.password-field-toggle {
    position: absolute;
    inset-inline-end: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #64748b;
    padding: 0.25rem 0.35rem;
    line-height: 1;
    border-radius: 8px;
}

.password-field-toggle:hover {
    color: #01305F;
    background: #f1f5f9;
}

.password-requirements {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #64748b;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.password-requirements li:last-child {
    margin-bottom: 0;
}

.password-requirements li .bi {
    font-size: 0.875rem;
    flex-shrink: 0;
}

.password-requirements li.is-met {
    color: #047857;
}

.password-requirements li.is-met .bi::before {
    content: '\F26B';
}

.password-requirements li:not(.is-met) .bi::before {
    content: '\F287';
}

.password-strength-bar {
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 0.35rem;
    margin-bottom: 0.85rem;
}

.password-strength-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.2s ease, background 0.2s ease;
}

.password-strength-bar-fill.is-weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-bar-fill.is-fair {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar-fill.is-strong {
    width: 100%;
    background: #10b981;
}

/* معاينة الصورة — تعديل الملف الشخصي */
.profile-edit-avatar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 1rem;
}

.profile-edit-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.phone-modal-body .form-control {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-size: 0.875rem;
}

.phone-modal-body .form-control:focus {
    border-color: #0089BF;
    box-shadow: 0 0 0 4px rgba(0, 137, 191, 0.1);
}
