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

.ci-form-wrap {
  font-family: 'Tajawal', sans-serif;
  max-width: 680px;
  margin: 0 auto;
  direction: rtl;
}

/* ===== CATEGORY SELECTOR ===== */
.ci-cat-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.ci-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: all .2s cubic-bezier(.34,1.56,.64,1);
  font-family: 'Tajawal', sans-serif;
  text-align: center;
}
.ci-cat-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.ci-cat-btn.selected {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,.12);
  border-width: 2px;
  color: #fff;
}
.ci-cat-icon  { font-size: 26px; line-height: 1; }
.ci-cat-label { font-size: 13px; font-weight: 700; }

/* ===== FORM GRID ===== */
.ci-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.ci-field-full { grid-column: 1 / -1; }
.ci-field { display: flex; flex-direction: column; gap: 6px; }
.ci-label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}
.ci-required { color: #ef4444; }

.ci-input,
.ci-select-input,
.ci-textarea-input {
  padding: 11px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  color: #0f172a;
  background: #fff;
  direction: rtl;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.ci-input:focus,
.ci-select-input:focus,
.ci-textarea-input:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15,23,42,.08);
}
.ci-input.ci-error,
.ci-textarea-input.ci-error { border-color: #ef4444; }

.ci-textarea-input { resize: vertical; min-height: 130px; line-height: 1.6; }
.ci-char-count { font-size: 12px; color: #9ca3af; text-align: left; margin-top: 4px; }

/* ===== ERRORS ===== */
.ci-errors {
  background: #fff5f5;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.ci-errors ul { margin: 0; padding: 0; list-style: none; }
.ci-errors li { color: #dc2626; font-size: 14px; font-weight: 600; padding: 3px 0; }
.ci-errors li::before { content: '⚠️ '; }

/* ===== SUBMIT BUTTON ===== */
.ci-form-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ci-form-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s cubic-bezier(.34,1.56,.64,1);
  position: relative;
  overflow: hidden;
}
.ci-form-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
}
.ci-form-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,.3); }
.ci-form-btn:disabled { opacity: .7; transform: none; cursor: not-allowed; }
.ci-btn-icon { font-size: 18px; }
.ci-privacy-note { font-size: 12px; color: #9ca3af; margin: 0; }

/* ===== SUCCESS STATE ===== */
.ci-success-msg {
  text-align: center;
  padding: 50px 24px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-radius: 20px;
  border: 2px solid #a7f3d0;
}
.ci-success-icon  { font-size: 64px; margin-bottom: 16px; animation: popIn .5s cubic-bezier(.34,1.56,.64,1); }
.ci-success-title { font-size: 22px; font-weight: 900; color: #065f46; margin: 0 0 8px; }
.ci-success-text  { font-size: 15px; color: #047857; margin: 0 0 24px; }
@keyframes popIn { from { transform: scale(0); opacity:0; } to { transform: scale(1); opacity:1; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .ci-cat-selector { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ci-cat-btn { padding: 10px 6px; }
  .ci-cat-icon { font-size: 22px; }
  .ci-cat-label { font-size: 11px; }
  .ci-form-grid { grid-template-columns: 1fr; }
}

/* Notice bar */
.ci-notice-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-right: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #92400e;
    font-weight: 600;
    margin-bottom: 20px;
    direction: rtl;
}
.ci-notice-icon { font-size: 16px; flex-shrink: 0; }

/* Optional label */
.ci-optional { font-size: 11px; color: #94a3b8; font-weight: 400; margin-right: 4px; }

/* Select input styling */
.ci-select-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
    direction: rtl;
    appearance: none;
    -webkit-appearance: none;
    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='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    cursor: pointer;
    transition: border .2s;
}
.ci-select-input:focus { outline: none; border-color: #6366f1; }
.ci-select-input.ci-error { border-color: #ef4444; }

/* Phone with country code */
.ci-phone-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.ci-country-select {
    flex-shrink: 0;
    width: 180px;
    padding: 12px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    direction: rtl;
    cursor: pointer;
    transition: border .2s;
    appearance: none;
    -webkit-appearance: none;
}
.ci-country-select:focus { outline: none; border-color: #6366f1; }
.ci-phone-input { flex: 1; margin: 0 !important; }
