/**
 * local_technicalissues — صفحة مستقلة، تصميم مطابق SDAIA/NELC
 * @package local_technicalissues
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

/* ── متغيرات ─────────────────────────────────────────────────────────────── */
:root {
    --ti-green:      #5bb200;
    --ti-green-dark: #4a9200;
    --ti-gray:       #f6f6f2;
    --ti-border:     rgba(5,52,74,.25);
    --ti-text:       #3b3b3b;
    --ti-radius:     5px;
    --ti-shadow:     0 0 5px rgba(1,77,113,.38);
    --ti-font:       'Cairo','Segoe UI',Tahoma,Arial,sans-serif;
}

/* ── إعادة ضبط لصفحة مستقلة ─────────────────────────────────────────────── */
.ti-standalone-body {
    margin: 0;
    padding: 0;
    background: rgb(15, 40, 55);
    font-family: var(--ti-font);
    color: var(--ti-text);
    direction: rtl;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

.ti-page {
    direction: rtl;
    min-height: 100vh;
    background: rgb(15, 40, 55);
    padding: 40px 16px 60px;
}

.ti-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 36px 32px 48px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* ── عنوان النموذج ───────────────────────────────────────────────────────── */
.ti-main-title {
    font-family: var(--ti-font);
    font-size: 2rem;
    font-weight: 700;
    color: var(--ti-green);
    text-align: center;
    margin-bottom: 14px;
}

.ti-main-desc {
    font-family: var(--ti-font);
    font-size: 1rem;
    color: #555;
    text-align: center;
    line-height: 2;
    margin-bottom: 28px;
}

/* ── إشعارات ─────────────────────────────────────────────────────────────── */
.ti-notice {
    font-family: var(--ti-font);
    font-size: .9rem;
    padding: 10px 16px;
    border-radius: var(--ti-radius);
    margin-bottom: 14px;
}
.ti-notice-info {
    background: #e8f4fd;
    border-right: 4px solid #0071b3;
    color: #0c5460;
}
.ti-notice-warn {
    background: #fff8e1;
    border-right: 4px solid #f59e0b;
    color: #856404;
}

.ti-alert-errors {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--ti-radius);
    color: #7f1d1d;
    padding: 12px 16px;
    font-family: var(--ti-font);
    font-size: .92rem;
    margin-bottom: 18px;
}

.ti-required-note {
    font-family: var(--ti-font);
    font-size: .85rem;
    color: #666;
    margin-bottom: 18px;
}
.ti-required-star { color: #dc3545; font-weight: 700; margin-left: 3px; }

/* ── Fieldset / Legend ───────────────────────────────────────────────────── */
.ti-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 24px;
}
.ti-legend {
    font-family: var(--ti-font);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ti-text);
    width: 100%;
    display: block;
    padding-bottom: 8px;
    margin: 20px 0 16px;
    border-bottom: 2px solid var(--ti-green);
}

/* ── صف مزدوج ────────────────────────────────────────────────────────────── */
.ti-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.ti-col {
    flex: 1 1 calc(50% - 10px);
    min-width: 200px;
}

/* ── حقل فردي ────────────────────────────────────────────────────────────── */
.ti-field { margin-bottom: 16px; }

/* ── تسمية ───────────────────────────────────────────────────────────────── */
.ti-label {
    display: block;
    font-family: var(--ti-font);
    font-weight: 600;
    font-size: .95rem;
    color: var(--ti-text);
    margin-bottom: 6px;
}
.ti-label.ti-required::after { content: ' *'; color: #dc3545; }

/* ── input / select ──────────────────────────────────────────────────────── */
.ti-input,
.ti-select {
    display: block;
    width: 100%;
    font-family: var(--ti-font);
    font-size: .95rem;
    color: var(--ti-text);
    background: #fff;
    border: 1px solid var(--ti-border);
    border-radius: var(--ti-radius);
    padding: 8px 12px;
    direction: rtl;
    transition: box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}
.ti-input:focus,
.ti-select:focus {
    outline: none;
    box-shadow: var(--ti-shadow);
}
.ti-input[readonly] {
    background: #f5f5f5;
    color: #777;
    cursor: not-allowed;
}

/* select arrow */
.ti-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 32px;
}

/* ── textarea ────────────────────────────────────────────────────────────── */
.ti-textarea {
    display: block;
    width: 100%;
    font-family: var(--ti-font);
    font-size: .95rem;
    color: var(--ti-text);
    background: #fff;
    border: 1px solid var(--ti-border);
    border-radius: var(--ti-radius);
    padding: 8px 12px;
    direction: rtl;
    resize: vertical;
    min-height: 110px;
    transition: box-shadow .2s;
}
.ti-textarea:focus {
    outline: none;
    box-shadow: var(--ti-shadow);
}

/* ── التاريخ والوقت ──────────────────────────────────────────────────────── */
.ti-datetime-row {
    display: flex;
    gap: 10px;
}
.ti-datetime-row .ti-input { flex: 2; }
.ti-time-input              { flex: 1 !important; min-width: 100px; }

/* ── عداد الأحرف ─────────────────────────────────────────────────────────── */
.ti-counter-msg {
    font-family: var(--ti-font);
    font-size: .78rem;
    color: #6b7280;
    margin-top: 4px;
    overflow: hidden;
}

/* ── رسالة خطأ حقل ───────────────────────────────────────────────────────── */
.ti-field-error {
    font-family: var(--ti-font);
    font-size: .82rem;
    color: #dc2626;
    margin-top: 4px;
}
.ti-has-error .ti-input,
.ti-has-error .ti-select,
.ti-has-error .ti-textarea,
.ti-has-error ~ .ti-input {
    border-color: #dc2626 !important;
}

/* ── رفع الملف ───────────────────────────────────────────────────────────── */
.ti-file-wrap {
    position: relative;
    border: 2px dashed var(--ti-border);
    border-radius: var(--ti-radius);
    background: var(--ti-gray);
    transition: border-color .2s, background .2s;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
}
.ti-file-wrap:hover,
.ti-file-wrap.ti-dragover {
    border-color: var(--ti-green);
    background: #f0fde0;
}
.ti-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}
.ti-file-ui {
    padding: 22px 16px;
    text-align: center;
    pointer-events: none;
}
.ti-upload-icon {
    font-size: 2rem;
    color: #9ca3af;
    display: block;
    margin-bottom: 8px;
}
.ti-file-wrap.ti-dragover .ti-upload-icon { color: var(--ti-green); }
.ti-upload-text  { font-family: var(--ti-font); font-size: .9rem; color: #555; margin: 0; }
.ti-upload-hint  { font-family: var(--ti-font); font-size: .76rem; color: #9ca3af; margin: 4px 0 0; }

.ti-file-chosen {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e8f9d4;
    border-radius: var(--ti-radius);
}
.ti-file-clear {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #dc2626;
    cursor: pointer;
    margin-right: auto;
    line-height: 1;
    padding: 0 4px;
}
.ti-file-desc {
    font-family: var(--ti-font);
    font-size: .76rem;
    color: #6b7280;
    display: block;
    margin-top: 5px;
}

/* ── زر الإرسال ─────────────────────────────────────────────────────────── */
.ti-actions { overflow: hidden; margin-top: 24px; }

.ti-btn-submit {
    font-family: var(--ti-font);
    font-size: 1rem;
    font-weight: 600;
    background-color: var(--ti-green);
    color: #fff;
    border: none;
    border-radius: var(--ti-radius);
    padding: 9px 0;
    width: 140px;
    cursor: pointer;
    float: left;
    transition: background-color .2s;
}
.ti-btn-submit:hover { background-color: var(--ti-green-dark); }

/* ── صفحة النجاح ─────────────────────────────────────────────────────────── */
.ti-success-box    { padding: 60px 20px; font-family: var(--ti-font); }
.ti-success-icon-fa{ font-size: 5rem; color: var(--ti-green); }
.ti-success-title  { font-size: 1.6rem; font-weight: 700; color: var(--ti-green); margin-bottom: 10px; }
.ti-success-msg    { font-size: 1rem; color: #555; margin-bottom: 20px; }

.ti-ticket-num {
    display: inline-block;
    background: #f0fde0;
    border: 1px solid #a3e635;
    border-radius: var(--ti-radius);
    padding: 10px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ti-green-dark);
}

.ti-success-btns {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 28px;
}
.ti-btn {
    font-family: var(--ti-font);
    font-size: .96rem;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 28px;
    border-radius: var(--ti-radius);
    display: inline-block;
    transition: background-color .2s;
}
.ti-btn-green   { background: var(--ti-green); color: #fff; }
.ti-btn-green:hover { background: var(--ti-green-dark); color: #fff; text-decoration: none; }
.ti-btn-outline { background: transparent; color: var(--ti-text); border: 1px solid #ccc; }
.ti-btn-outline:hover { background: #f5f5f5; text-decoration: none; }

/* ── استجابة ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ti-row { flex-direction: column; gap: 0; }
    .ti-col { flex: 1 1 100%; }
    .ti-datetime-row { flex-direction: column; }
    .ti-time-input   { flex: unset !important; }
    .ti-main-title   { font-size: 1.4rem; }
    .ti-btn-submit   { float: none; width: 100%; }
}
@media (max-width: 480px) {
    .ti-main-title { font-size: 1.2rem; }
    .ti-container  { padding: 16px 12px 40px; }
}
