/* === Instructions Card === */
.instructions-card {
    background: #f3f4f6;
    border-left: 4px solid #2563eb;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 20px auto 20px;
    width: calc(100% - 10px);
    max-width: 1400px;
    font-size: 14px;
    color: #374151;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.instructions-card h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: bold;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.instructions-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
}
.instructions-card li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.instructions-card li i {
    color: #2a8701;
    font-size: 14px;
}


/* === Progress Sidebar (Full Height) === */
.progress-sidebar {
    width: 240px;
    background: #f9fafb;
    border-left: 3px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    box-shadow: inset -1px 0 0 rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    height: 100%;       /* طول كامل */
}

/* الخطوة */
.progress-sidebar .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

/* الدائرة */
.progress-sidebar .circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: all .3s ease;
    z-index: 2;
}

/* النص */
.progress-sidebar .label {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    max-width: 160px;
    line-height: 1.4;
}

/* الخط بين الدوائر */
.progress-sidebar .line {
    width: 3px;
    flex: 1;
    background: #e5e7eb;
    margin: 8px 0;
    border-radius: 2px;
    position: relative;
}

/* ===== الحالات ===== */
.progress-sidebar .step.active .circle {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 0 0 5px rgba(37,99,235,0.2);
}

.progress-sidebar .step.active .label {
    color: #2563eb;
}

.progress-sidebar .step.done .circle {
    background: #16a34a;
    color: #fff;
}

.progress-sidebar .step.done .label {
    color: #16a34a;
}





/* === Progress (داخل main-div-content) === */
.progress-wrap{
    position: sticky;
    top: 0;
    z-index: 5;
    padding-bottom: 12px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0,0,0,.04);
    flex-shrink: 0;
}
.progress-track{
    width: 100%;
    height: 6px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.progress-bar{
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #a3e635, #facc15);
    transition: width .25s ease;
}

.input-error{ border:1px solid #dc3545 !important; }
.error-inline{ color:#dc3545; font-size:.9rem; margin:.25rem 0 .5rem; display:none; }


.auth-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    margin: 0 auto 20px;
    width: 95vw;
    height: 550px;
    overflow: hidden;           /* عشان ما يطلع سكرول غريب */
    display: flex;
    flex-direction: row;        /* 👈 خليهم جنب بعض */
    align-items: flex-start;    /* يبدأوا من فوق */
    gap: 20px;                  /* مسافة بينهم */
}

/* === الحاوية الرئيسية داخل auth-container === */
.main-div-content {
    flex: 1;                          /* ياخذ المساحة المتبقية جنب السايدبار */
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-inline-start: 20px;        /* مسافة بينه وبين progress-sidebar */
    box-shadow: inset 0 0 0 1px #e5e7eb;  /* إطار داخلي خفيف */
    height: 570px;                    /* نفس الطول اللي حددته */
    overflow-y: auto;                 /* يخلي التمرير عمودي فقط */
    overflow-x: hidden;               /* يمنع التمرير الأفقي */
    display: flex;
    flex-direction: column;

}



/* لو تبغى المحتوى يكون Scrollbar أنيق */
.main-div-content::-webkit-scrollbar {
    width: 8px;
}
.main-div-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}
.main-div-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


.step-host{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-top: 8px;
    padding-bottom: 20px;
}
.add-project-card.step { display: none; }

.main-div-content .add-project-card {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

/* === Sections & Forms === */
.section-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: #0f172a;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}
.section-title i{
    color: #2a8701;
    font-size: 18px;
}

.project-form {
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px; /* مسافة بين اللابل والفيلد */
    margin-bottom: 18px; /* مسافة بين الجروب والجروب */
}
/* تصغير المسافة بين الحقول في الجريد */
.form-group.grid-2,
.form-group.grid-3,
.form-group .grid-4 {
    display: grid;
    gap: 16px; /* مسافة أوسع بين الحقول */
}
.form-group.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.form-group.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.form-group .grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}


.form-control {
    width: 100%;            /* ياخذ العرض كامل */
    padding: 10px 14px;     /* راحة داخلية */
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* عند التركيز */
.form-control:focus {
    border-color: #0ea5e9; /* أزرق */
    box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* لتكبير الايميل والتخصص والهواتف */
input[type="email"],
input[type="number"],
input[type="text"],
input[type="password"] {
    font-size: 0.95rem;
}

.required {
    color: red;
    font-weight: bold;
    margin: 0 2px;
}

.form-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e5e7eb;
    z-index: 15;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
    flex-shrink: 0; /* يمنع الانكماش */
}

.form-actions-modal {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #e5e7eb;
    z-index: 15;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
    flex-shrink: 0; /* يمنع الانكماش */
}



/* === Buttons === */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background .2s ease, transform .15s ease;
}
.btn-primary {
    background: #2563eb;
    color: #fff;
}
.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}
.btn-secondary {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s ease;
}
.btn-secondary:hover { background: #e5e7eb; }
.btn-secondary:disabled { opacity: .6; cursor: not-allowed; }

/* === Switch (عام) === */
.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #1f2937;
}
.hint {
    color:#6b7280;
    font-size:12px;
    font-weight: bold;
}
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}
.switch input { display:none; }
.slider {
    position:absolute; cursor:pointer; inset:0;
    background:#e5e7eb; transition:.2s; border-radius: 999px;
}
.slider:before {
    position:absolute; content:""; height:20px; width:20px; right:4px; top:3px;
    background:#fff; transition:.2s; border-radius: 999px; box-shadow:0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background:#2563eb; }
.switch input:checked + .slider:before { transform: translateX(-22px); }

/* === Team members === */
.members-wrapper.hidden { display:none; }

.team-member {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;  /* اسم - رقم - مهمة - حذف */
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}
.remove-member {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color:#b91c1c;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition:.2s;
}
.remove-member:disabled { opacity:.5; cursor:not-allowed; }
.remove-member:hover:not(:disabled) { background:#fecaca; }

/* === Finance === */
.finance-wrapper.hidden { display:none; }
.finance-grid{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin:8px 0;
}
.line-item{
    display:grid;
    grid-template-columns: 2fr 1fr 1.2fr 1.2fr auto;
    gap:10px;
    align-items:center;
}
.line-item .subtotal{
    background:#f3f4f6;
    border:1px solid #e5e7eb;
    border-radius:8px;
    padding:10px 12px;
    font-size:14px;
    text-align:center;
    color:#111827;
}
.remove-item{
    background:#fee2e2;
    border:1px solid #fca5a5;
    color:#b91c1c;
    border-radius:8px;
    padding:8px 10px;
    cursor:pointer;
    transition:.2s;
}
.remove-item:disabled{ opacity:.5; cursor:not-allowed; }
.remove-item:hover:not(:disabled){ background:#fecaca; }
.num{ text-align:left; direction:ltr; }

.total-row{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:10px;
    margin-top:8px;
    font-size:15px;
}
.total-row strong{ font-size:16px; }

.feasibility-inline{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}
@media (max-width:720px){
    .line-item{ grid-template-columns:1fr 1fr 1fr 1fr auto; }
    .feasibility-inline{ grid-template-columns:1fr; }
}

/* === Files === */
.file-input {
    padding: 8px;
    background: #f9fafb;
    cursor: pointer;
}

.file-status {
    margin-top: 5px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.file-status i { font-size: 1rem; }
.file-status.pending { color: #555; }
.file-status.clean { color: #16a34a; }   /* أخضر */
.file-status.infected { color: #dc2626; } /* أحمر */

/* === Agree form === */
.agree-row { margin: 6px 0 4px; }
.agree-check {
    display:flex; align-items:center; gap:10px; cursor:pointer; user-select:none;
}
.agree-check input { display:none; }
.checkmark {
    width:20px; height:20px; border:2px solid #2563eb; border-radius:6px;
    display:inline-block; position:relative; background:#fff; flex-shrink:0;
}
.agree-check input:checked + .checkmark {
    background:#2563eb; border-color:#2563eb;
}
.agree-check input:checked + .checkmark::after {
    content:""; position:absolute; right:5px; top:2px; width:6px; height:10px;
    border-right:2px solid #fff; border-bottom:2px solid #fff; transform:rotate(45deg);
}
.agree-text { color:#1f2937; font-size:14px; }
#final-submit:disabled { opacity:.6; cursor:not-allowed; }

.projects-content{
    padding: 20px;
    margin-top: 80px;
    margin-right: 80px;
    display: grid;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.projects-page {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    min-height: 81vh;
}

.projects-page h2 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.projects-page h2 i {
    color: #2563eb; /* أزرق أنيق للأيقونة */
}

/* تنسيق الجدول */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    overflow: hidden;
}

.table thead {
    background: #f1f5f9;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    font-weight: bold;
    color: #1e293b;
    font-size: 13px;
}

.table tbody tr:hover {
    background: #f9fafb;
    transition: background 0.2s ease;
}

.table td {
    color: #334155;
}


.files-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
    margin-top: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}
.files-table thead th {
    background: #f8fafc;
    font-weight: 600;
    text-align: right;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #0f172a;
}
.files-table tbody td {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.files-table tbody tr:nth-child(even) { background: #fcfdff; }
.files-table tbody tr:last-child td { border-bottom: 0; }
.files-table .file-del.btn.btn-danger {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
}
.file-status.pending { color:#0ea5e9; }
.file-status.clean   { color:#16a34a; }
.file-status.infected{ color:#dc2626; }

/* خلي الجدول scrollable فالشاشات الصغيرة */
.projects-page {
    overflow-x: auto;
}


.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #000;
}

.badge-success {
    background: #16a34a; /* أخضر */
}

.badge-warning {
    background: #f59e0b; /* أصفر */
}

.badge-danger {
    background: #dc2626; /* أحمر */
}

.badge-strong {
    color: #16a34a; /* أخضر */
}

.badge-neutral {
    color: #6b7280; /* أصفر */
}

.badge-weak {
    color: #dc2626; /* أحمر */
}

.badge-secondary {
    background: #6b7280; /* رمادي */
}
.btn-show {
    background: #2563eb;        /* أزرق أساسي */
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-show:hover {
    background: #1e40af;        /* أزرق أغمق عند المرور */
    transform: scale(1.05);
}

.btn-show:active {
    transform: scale(0.95);
}


/* حاوية حقل المدة مع اللاحقة */
.phase-duration {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
}

/* مدخل الرقم – نزيد حشوة الجهة اليسار/النهاية للـ RTL عشان ما تتصادم اللاحقة */
.phase-duration > input.form-control {
    padding-inline-end: 3.5rem; /* مساحة لكلمة "أشهر" */
    text-align: center;         /* اختياري: وسّط الرقم */
}

/* شكل اللاحقة */
.phase-duration .suffix {
    position: absolute;
    inset-inline-end: .75rem;  /* يمين في RTL */
    color: #64748b;
    font-size: .9rem;
    pointer-events: none;
    user-select: none;
}

/* إخفاء أسهم input[type=number] (اختياري) */
.phase-duration > input[type="number"] {
    -moz-appearance: textfield;
}
.phase-duration > input[type="number"]::-webkit-outer-spin-button,
.phase-duration > input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}



.password-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-group .pw-input {
    position: relative;
}

.password-group .pw-input .form-control {
    padding-inline-end: 42px;
}

.password-group .pw-toggle {
    position: absolute;
    inset-inline-end: 8px;
    inset-block-start: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #64748b;
    padding: 6px;
    border-radius: 8px;
}

.password-group .pw-toggle:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.pw-meter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.pw-meter .seg {
    height: 8px;
    border-radius: 6px;
    background: #e5e7eb;
    transition: background .25s ease, transform .25s ease;
}

.pw-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pw-req {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    font-size: 13px;
    color: #64748b;
}

.pw-match {
    margin-top: 6px;
}
.password-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* عمودين */
    gap: 24px; /* مسافة بينهم */
    margin-bottom: 20px;
}

.password-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 768px) {
    .password-row {
        grid-template-columns: 1fr; /* في الموبايل يصيروا تحت بعض */
    }
}

.close-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    z-index: 999;
}

.closed-message {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px;
    max-width: 660px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    animation: fadeInUp 0.4s ease;
}

.icon-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.icon-box i {
    font-size: 2rem;
    color: #dc2626;
}

.closed-message h2 {
    font-size: 1.6rem;
    color: #111827;
    margin-bottom: 8px;
}

.closed-message .subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 20px;
}

.closed-message .dates {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.closed-message .date-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.closed-message .date-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.closed-message .date-card h4 {
    font-size: 1rem;
    color: #111827;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.closed-message .date-card h4 i {
    font-size: 1.1rem;
}

.closed-message .date-card.start h4 i {
    color: #16a34a; /* أخضر */
}

.closed-message .date-card.end h4 i {
    color: #dc2626; /* أحمر */
}

.closed-message .date-card p {
    font-size: 0.95rem;
    color: #374151;
    margin: 0;
}


.btn-home {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border:  none;
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.field-wrap {
    position: relative;
}
.field-status {
    position: absolute;
    inset-inline-end: 10px;
    inset-block-start: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
}
.has-status {
    padding-inline-end: 2.2rem !important;
}

.field-msg {
    font-size: 0.8rem;
    margin-top: 3px;
}
.field-msg.ok { color: #16a34a; }     /* أخضر */
.field-msg.bad { color: #dc2626; }    /* أحمر */
.field-msg.spin { color: #2563eb; }   /* أزرق */

