/* =========================================================
   Nour Public Site — Complaint submit + tracking
   ========================================================= */

/* ================= Submit (create) ================= */

#ccForm { counter-reset: cc-step; }

.cc-success,
.cc-error {
    display: flex;
    gap: 0.65rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.75;
    border-radius: var(--radius);
    border: 1px solid;
}

.cc-success { color: #067647; background: #ECFDF3; border-color: #ABEFC6; }
.cc-error { color: #B42318; background: #FEF3F2; border-color: #FECDCA; }
.cc-error i { margin-top: 3px; flex-shrink: 0; }
.cc-error ul { list-style: none; margin: 0; padding: 0; }

/* Request type: two large choice tiles */
.cc-type-section {
    padding: 1.6rem 1.75rem;
    margin-bottom: 1.25rem;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s var(--ease);
}

.cc-type-title { font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.cc-type-title .req, .cc-label .req { color: var(--danger); }

.cc-type-hint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.3rem 0 1.15rem;
    font-size: 0.88rem;
    color: var(--text-label);
}

.cc-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.cc-type-opt { position: relative; }
.cc-type-opt input { position: absolute; opacity: 0; pointer-events: none; }

.cc-type-opt label {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}

.cc-type-opt label:hover { border-color: var(--primary-200); }
.cc-type-opt input:focus-visible + label { box-shadow: 0 0 0 4px rgba(36, 48, 143, 0.15); }

.cc-type-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 12px;
    font-size: 1.2rem;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.cc-type-opt:first-child .cc-type-icon { background: #FEF3F2; color: #D92D20; }
.cc-type-opt:last-child .cc-type-icon { background: var(--primary-soft); color: var(--primary); }

.cc-type-opt:first-child input:checked + label { border-color: #F97066; background: #FFFBFA; box-shadow: 0 0 0 4px #FEE4E2; }
.cc-type-opt:last-child input:checked + label { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 4px var(--primary-100); }
.cc-type-opt:first-child input:checked + label .cc-type-icon { background: #D92D20; color: #fff; }
.cc-type-opt:last-child input:checked + label .cc-type-icon { background: var(--primary); color: #fff; }

@keyframes ccShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Numbered field groups */
.cc-group {
    padding: 1.6rem 1.75rem 0.5rem;
    margin-bottom: 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.cc-section {
    counter-increment: cc-step;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.4rem;
    padding-bottom: 0.95rem;
    font-size: 1.07rem;
    font-weight: 800;
    color: var(--ink);
    border-bottom: 1px solid var(--border-soft);
}

.cc-section::before {
    content: counter(cc-step);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    font-size: 0.85rem;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 0 0 5px var(--primary-soft);
}

.cc-section > .bi { color: var(--primary); }

.cc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.cc-field { margin-bottom: 1.25rem; }

.cc-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.cc-label > .bi { color: var(--text-label); }

.cc-input,
.cc-select,
.cc-textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.95rem;
    font-family: inherit;
    font-size: 0.98rem;
    color: var(--text-main);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.cc-select { cursor: pointer; }
.cc-textarea { min-height: 140px; resize: vertical; line-height: 1.85; }

.cc-input:focus,
.cc-select:focus,
.cc-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(36, 48, 143, 0.12);
}

.cc-input[type="file"] { padding: 0.55rem 0.7rem; cursor: pointer; }

.cc-input[type="file"]::file-selector-button {
    margin-inline-end: 0.75rem;
    padding: 0.4rem 0.9rem;
    font-family: inherit;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.cc-field-error { margin-top: 0.35rem; font-size: 0.83rem; font-weight: 600; color: var(--danger); }

#image-preview img {
    max-width: 220px;
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.cc-submit {
    width: 100%;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.cc-submit:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 12px 24px -12px rgba(36, 48, 143, 0.6);
    transform: translateY(-1px);
}

.cc-submit:disabled { opacity: 0.7; cursor: wait; }

/* ================= Tracking ================= */

.tk-wrap { max-width: 860px; margin: 0 auto; }

.tk-search {
    padding: 0.65rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.tk-search form { display: flex; gap: 0.6rem; }

.tk-search-input {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 1rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ink);
    background: var(--bg-page);
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}

.tk-search-input::placeholder { font-weight: 500; letter-spacing: 0; color: #98A2B3; }

.tk-search-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(36, 48, 143, 0.12);
}

.tk-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 52px;
    padding: 0 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s var(--ease);
}

.tk-search-btn:hover { background: var(--primary-hover); }

.tk-alert { max-width: 860px; margin: 1.25rem auto 0; }

.tk-alert-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.15rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid;
    border-radius: var(--radius);
}

.tk-alert-success { color: #067647; background: #ECFDF3; border-color: #ABEFC6; }
.tk-alert-error { color: #B42318; background: #FEF3F2; border-color: #FECDCA; }

.tk-result { max-width: 860px; margin: 1.5rem auto 0; }

.tk-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.tk-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: var(--primary-soft);
    border-bottom: 1px solid var(--primary-100);
}

.tk-code-label { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); }

.tk-code-val {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--primary);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.tk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-soft);
}

.tk-header-title { font-size: 1.1rem; font-weight: 800; color: var(--ink); }

.tk-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-subtle);
}

.tk-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tk-badge-pending { color: #B54708; background: #FFFAEB; }
.tk-badge-in_progress { color: #175CD3; background: #EFF8FF; }
.tk-badge-resolved { color: #067647; background: #ECFDF3; }
.tk-badge-rejected { color: #B42318; background: #FEF3F2; }

.tk-body { padding: 0.5rem 1.75rem 1.75rem; }

.tk-section-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 1.5rem 0 0.85rem;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--ink);
}

.tk-section-title i {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.9rem;
}

.tk-info-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }

.tk-info-item {
    padding: 0.85rem 1rem;
    background: var(--bg-page);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.tk-info-label { font-size: 0.82rem; font-weight: 600; color: var(--text-label); margin-bottom: 0.2rem; }
.tk-info-val { font-size: 0.98rem; font-weight: 700; color: var(--ink); word-break: break-word; }

.tk-msg {
    margin-top: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.tk-msg-label { font-size: 0.85rem; font-weight: 700; color: var(--text-label); margin-bottom: 0.45rem; }
.tk-msg-text { font-size: 1rem; line-height: 1.9; color: var(--text-secondary); white-space: pre-line; }
.tk-image img { max-width: 100%; max-height: 360px; border-radius: var(--radius); }

.tk-response {
    margin-top: 1.25rem;
    padding: 1.25rem 1.4rem;
    background: #F6FEF9;
    border: 1px solid #ABEFC6;
    border-inline-start: 4px solid var(--success);
    border-radius: var(--radius);
}

.tk-response-label { display: flex; align-items: center; gap: 0.45rem; font-weight: 800; color: #067647; margin-bottom: 0.5rem; }
.tk-response-text { font-size: 1rem; line-height: 1.9; color: var(--text-secondary); }
.tk-response-date { margin-top: 0.6rem; font-size: 0.83rem; color: var(--text-label); }

.tk-pending {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #B54708;
    background: #FFFAEB;
    border: 1px solid #FEDF89;
    border-radius: var(--radius);
}

.tk-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    background: #fff;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-xl);
}

.tk-empty i {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    font-size: 1.4rem;
    color: var(--text-label);
    background: var(--bg-subtle);
    border-radius: 50%;
}

.tk-empty p { margin: 0; font-size: 1rem; color: var(--text-muted); }

/* ================= Responsive ================= */
@media (max-width: 768px) {
    .cc-type-section, .cc-group { padding: 1.25rem 1.1rem 0.4rem; }
    .cc-type-section { padding-bottom: 1.25rem; }
    .cc-type-grid, .cc-row { grid-template-columns: 1fr; }
    .tk-search form { flex-direction: column; }
    .tk-search-btn { justify-content: center; }
    .tk-code, .tk-header { padding: 1rem 1.15rem; }
    .tk-body { padding: 0.25rem 1.15rem 1.25rem; }
}
