/* INSURA VAULT — Base Styles & Reset */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--neutral-100);
  color: var(--neutral-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--brand-accent); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

.hidden { display: none !important; }

/* ---- Typography ---- */
h1 { font-size: var(--text-3xl); font-weight: var(--weight-extrabold); letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }

/* ---- Form Elements ---- */
.app-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--neutral-200);
  border-radius: 10px;
  background: var(--neutral-50);
  font-size: var(--text-base);
  color: var(--neutral-800);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
}
.app-input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
  background: #fff;
}
.app-input::placeholder { color: var(--neutral-400); }
.app-input.textarea { resize: vertical; min-height: 80px; }

select.app-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.input-group { margin-bottom: 16px; }
.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--neutral-600);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-2));
  color: #fff;
  font-weight: var(--weight-semibold);
  border-radius: 10px;
  font-size: var(--text-base);
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79,110,247,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79,110,247,0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-full { width: 100%; }
.btn-primary.btn-sm { padding: 8px 16px; font-size: var(--text-sm); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--neutral-200);
  color: var(--neutral-700);
  font-weight: var(--weight-medium);
  border-radius: 10px;
  font-size: var(--text-sm);
  transition: all var(--transition-base);
  background: #fff;
}
.btn-outline:hover {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
  background: rgba(79,110,247,0.04);
}

.btn-renew {
  padding: 8px 20px;
  background: var(--color-warning);
  color: #fff;
  font-weight: var(--weight-semibold);
  border-radius: 8px;
  font-size: var(--text-sm);
  transition: all var(--transition-base);
}
.btn-renew:hover { background: #e08e00; }

.link-btn {
  color: var(--brand-accent);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.back-link {
  color: var(--brand-accent);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  background: none;
  border: none;
}

/* ---- Utility ---- */
.loading-state,
.empty-state,
.error-state {
  text-align: center;
  color: var(--neutral-400);
  padding: 40px 20px;
  font-size: var(--text-sm);
}
.loading-state { position: relative; }
.loading-state::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid var(--neutral-300);
  border-top-color: var(--brand-accent, #4f6ef7);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { color: var(--neutral-500); }
.error-state { color: var(--color-danger, #ef4444); }

.section-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--neutral-800);
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.form-card {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}

/* ---- Status Badges ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--border-radius-full);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-badge--active, .status-badge--completed, .status-badge--approved, .status-badge--settled, .status-badge--won { background: var(--color-success-light); color: #059669; }
.status-badge--expired, .status-badge--rejected, .status-badge--lost, .status-badge--overdue, .status-badge--cancelled { background: var(--color-danger-light); color: #dc2626; }
.status-badge--requested, .status-badge--submitted, .status-badge--new, .status-badge--pending, .status-badge--initiated { background: var(--color-info-light); color: #2563eb; }
.status-badge--assigned, .status-badge--contacted, .status-badge--in_progress, .status-badge--interested, .status-badge--under_review, .status-badge--scheduled { background: var(--color-warning-light); color: #d97706; }
.status-badge--quotation_sent, .status-badge--quotation, .status-badge--customer_approved, .status-badge--negotiation { background: #f0e6ff; color: #7c3aed; }
.status-badge--sent_to_insurer, .status-badge--submitted_to_insurer, .status-badge--surveyor_assigned, .status-badge--survey_completed, .status-badge--under_processing { background: #e0f2fe; color: #0284c7; }
.status-badge--payment_initiated, .status-badge--lapsed { background: #fef3c7; color: #b45309; }

/* Category badges */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--border-radius-full);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  text-transform: capitalize;
}
.category-badge--motor { background: var(--color-motor-light); color: var(--color-motor); }
.category-badge--health { background: var(--color-health-light); color: #059669; }
.category-badge--property { background: var(--color-property-light); color: #b45309; }
.category-badge--transit { background: var(--color-transit-light); color: var(--color-transit); }
.category-badge--business { background: var(--color-business-light); color: var(--color-business); }

/* Priority badges */
.priority-badge { display: inline-block; padding: 2px 8px; border-radius: var(--border-radius-full); font-size: 11px; font-weight: var(--weight-semibold); }
.priority-badge--high { background: var(--color-danger-light); color: #dc2626; }
.priority-badge--medium { background: var(--color-warning-light); color: #d97706; }
.priority-badge--low { background: var(--color-success-light); color: #059669; }

/* ---- Password toggle ---- */
.password-wrap { position: relative; }
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.animate-fade-in { animation: fadeIn 0.3s ease both; }
.animate-slide-up { animation: slideUp 0.4s ease both; }
.animate-scale-in { animation: scaleIn 0.3s ease both; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--neutral-200) 25%, var(--neutral-100) 50%, var(--neutral-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-card { height: 80px; border-radius: var(--border-radius); }

/* Stagger children animation */
.stagger-children > * { animation: fadeIn 0.3s ease both; }
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }
