/* ═══════════════════════════════════════════════════
   COMPONENTS.CSS — Uncle AI
   Reusable UI components shared across 2+ pages.
   ── .error-msg / .success-msg: login, signup, profile
   ── .section-label: signup, profile
   ── .field-row: signup, profile
   ── .card (base): login, signup, profile
   ── .spinner + @keyframes spin: dashboard
   ── .loading: dashboard
   ── .modal-overlay + .modal: dashboard
   ═══════════════════════════════════════════════════ */

/* ── ERROR / SUCCESS MESSAGES ── */
.error-msg {
  background: #FFF0F0;
  border: 1px solid #F0C0C0;
  color: #C0392B;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.success-msg {
  background: #F5EDE3;
  border: 1px solid #E8C9A8;
  color: #4A3728;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ── SECTION LABEL (signup + profile) ── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #B8947A;
  margin-bottom: 14px;
}

/* ── FIELD ROW (signup + profile) ── */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* ── CARD BASE ── */
.card {
  background: white;
  border: 1px solid #E8C9A8;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
}
@media (max-width: 480px) { .card { padding: 28px 20px; } }

/* ── SPINNER ── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid #E8C9A8;
  border-top-color: #D4845A;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOADING STATE ── */
.loading { text-align: center; padding: 40px; color: #B8947A; font-size: 14px; }

/* ── MODAL OVERLAY ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: white;
  border-radius: 14px;
  padding: 28px 24px 20px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  animation: modalIn 0.18s ease;
}
@keyframes modalIn {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-icon { font-size: 28px; margin-bottom: 12px; }
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.modal p { font-size: 14px; color: #7A5A42; line-height: 1.5; margin-bottom: 20px; }
.modal-title-preview { font-weight: 600; color: #2A1A0E; }
.modal-btns { display: flex; gap: 10px; }
.modal-btn-cancel {
  flex: 1; padding: 11px;
  background: #F5E6D3; border: none;
  border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif;
  color: #4A3728; transition: background 0.15s;
}
.modal-btn-cancel:hover { background: #E8C9A8; }
.modal-btn-delete {
  flex: 1; padding: 11px;
  background: #C0392B; border: none;
  border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif;
  color: white; transition: background 0.15s;
}
.modal-btn-delete:hover { background: #A93226; }
.modal-btn-delete:disabled { background: #E8A09A; cursor: not-allowed; }

/* ── Residence form helpers ───────────────────────────────────────── */
.field-optional {
  font-size: 11px;
  font-weight: 400;
  color: #9CA3AF;
  margin-left: 4px;
}
.field-hint {
  font-size: 12px;
  color: #6B7280;
  margin-top: 5px;
  line-height: 1.4;
}
