/* ─────────────── Design Tokens ─────────────── */
:root {
  --primary: #7b61ff;
  --primary-hover: #6a4ef0;
  --primary-light: #ede8ff;
  --primary-glow: rgba(123, 97, 255, .18);
  --bg: #f4f2fb;
  --card-bg: #ffffff;
  --text: #1e1e2f;
  --text-secondary: #6b6b80;
  --border: #e2e0ed;
  --border-focus: #bdb4ff;
  --danger: #ff4d6a;
  --danger-hover: #e63e58;
  --success: #10b981;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(30, 30, 47, .07);
  --shadow-lg: 0 12px 48px rgba(30, 30, 47, .12);
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─────────────── Reset & Base ─────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 80px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────── Card Container ─────────────── */
.form-card {
  width: 100%;
  max-width: 720px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 48px 44px 40px;
  animation: fadeUp .5s var(--transition);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────── Header ─────────────── */
.form-header {
  text-align: center;
  margin-bottom: 36px;
}


.form-logo {
  margin-bottom: 12px;
}

.form-logo img {
  width: 60px;   /* adjust size */
  height: auto;
}

.form-logo img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}




.form-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.form-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* ─────────────── Sections ─────────────── */
.form-section {
  margin-bottom: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type { border-bottom: none; }

.section-title {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.section-number {
  background: var(--primary);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: -10px 0 18px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header-row .section-title { margin-bottom: 0; }

/* ─────────────── Fields ─────────────── */
.field-group {
  margin-bottom: 18px;
}

.field-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.req { color: var(--danger); }

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder { color: #b5b3c6; }

.field-row {
  display: flex;
  gap: 16px;
}

.field-row .field-group { flex: 1; }

/* Input prefix (+91) */
.input-group {
  display: flex;
}

.input-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--primary-light);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.input-group input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ─────────────── Error State ─────────────── */
.field-group.has-error input,
.field-group.has-error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 77, 106, .15);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.field-group.has-error .field-error {
  display: block;
}

/* ─────────────── Buttons ─────────────── */
.btn-add-event {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-add-event:hover {
  background: var(--primary);
  color: #fff;
}

.btn-submit {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-top: 8px;
}

.btn-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-submit:active { transform: translateY(0); }

.btn-submit:disabled {
  background: #bbb;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.btn-secondary:hover { background: #f5f4fa; }

/* ─────────────── Events Table ─────────────── */
.events-table-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.events-table thead {
  background: var(--primary-light);
}

.events-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  white-space: nowrap;
}

.events-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.events-table tbody tr {
  transition: background var(--transition);
}

.events-table tbody tr:hover {
  background: #fafafe;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  font-size: 16px;
  line-height: 1;
}

.action-btn.edit { color: var(--primary); }
.action-btn.edit:hover { background: var(--primary-light); }
.action-btn.delete { color: var(--danger); }
.action-btn.delete:hover { background: #fff0f3; }

/* ─────────────── Budget Cards ─────────────── */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.budget-card {
  cursor: pointer;
}

.budget-card input { display: none; }

.card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card-inner:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.budget-card input:checked + .card-inner {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.card-label {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.budget-card input:checked + .card-inner .card-label {
  background: var(--primary);
  color: #fff;
}

.card-range {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.other-budget-wrap {
  margin-top: 16px;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────── Modal ─────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 47, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 92%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: scale(.92) translateY(16px);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f2fa;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.modal-close:hover { background: #e7e5f2; }

.modal-body {
  padding: 24px;
}

.modal-body .field-group:last-child { margin-bottom: 0; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fbfaff;
}

/* ─────────────── Success Message ─────────────── */
.success-message {
  text-align: center;
  padding: 60px 20px;
  animation: fadeUp .6s ease;
}

.success-icon {
  font-size: 52px;
  margin-bottom: 16px;
}

.success-message h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--success);
}

.success-message p {
  color: var(--text-secondary);
  font-size: 14.5px;
}

/* ─────────────── Responsive ─────────────── */
@media (max-width: 768px) {
  body { padding: 20px 10px 60px; }

  .form-card { padding: 32px 20px 28px; border-radius: 16px; }

  .form-header h1 { font-size: 22px; }

  .field-row { flex-direction: column; gap: 0; }

  .section-header-row { flex-direction: column; align-items: flex-start; gap: 12px; }

  .budget-grid { grid-template-columns: repeat(2, 1fr); }

  .events-table-wrap { overflow-x: auto; }

  .events-table { min-width: 540px; }

  .modal { width: 96%; }
}

@media (max-width: 400px) {
  .form-card { padding: 24px 14px 20px; }
}
