/* =========================================================
   Subsidy Application Form — Stylesheet
   Theme: Refined Government / Institutional
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  --bg:           #f4f3f0;
  --surface:      #ffffff;
  --surface-alt:  #fafaf8;
  --border:       #dddbd6;
  --border-focus: #2d5be3;
  --text-primary: #1a1916;
  --text-muted:   #6b6860;
  --text-label:   #3d3b37;
  --accent:       #2d5be3;
  --accent-light: #eef1fc;
  --accent-dark:  #1e3fa0;
  --success:      #1a7f5a;
  --success-bg:   #edf7f3;
  --error:        #b91c1c;
  --error-bg:     #fef2f2;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --radius:       6px;
  --radius-lg:    10px;
  --transition:   0.18s ease;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 40px 20px 80px;
}

/* ── Page Layout ────────────────────────────────────────── */
h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

h2::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  margin-top: 8px;
  border-radius: 2px;
}

form {
  max-width: 680px;
  margin: 0 auto;
}

/* ── Flash Messages ─────────────────────────────────────── */
.flash-messages {
  margin-bottom: 24px;
}

[style*="color:green"] {
  background: var(--success-bg);
  color: var(--success) !important;
  border: 1px solid #a7f3d0;
  border-left: 4px solid var(--success);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* ── Sections ───────────────────────────────────────────── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.section:hover {
  box-shadow: var(--shadow-md);
}

.section h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* ── Labels ─────────────────────────────────────────────── */
label,
.section > label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-label);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

/* ── Text / Number Inputs ───────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-light);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
select:disabled {
  background: #f0efec;
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border);
}

/* ── Select Arrow ───────────────────────────────────────── */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6860' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Radio Buttons ──────────────────────────────────────── */
input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-right: 6px;
  vertical-align: middle;
}

/* Radio group rows */
.section input[type="radio"] + label,
input[type="radio"] ~ label {
  display: inline;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0;
  cursor: pointer;
}

/* Wrap radio options in a flex row for neatness */
.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  background: var(--surface-alt);
}

.radio-group label:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.radio-group input[type="radio"]:checked + label,
.radio-group label:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 500;
}

/* ── Conditional / Hidden Sections ─────────────────────── */
.hidden {
  display: none;
}

#owner_section,
#lease_section,
#expansion_section,
#loan_section {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Field Spacing ──────────────────────────────────────── */
.section br {
  display: block;
  content: '';
  margin-bottom: 4px;
}

/* Spacing between consecutive field blocks within a section */
.section > label + input,
.section > label + select {
  margin-bottom: 16px;
}

/* ── Pincode field – monospace for clarity ──────────────── */
#pincode {
  font-family: 'DM Mono', monospace;
  letter-spacing: 2px;
  max-width: 160px;
}

/* ── Contact Email ──────────────────────────────────────── */
#contact_email {
  max-width: 340px;
}

/* ── Submit Button ──────────────────────────────────────── */
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 32px;
  background: var(--accent);
  color: #ffffff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  box-shadow: 0 2px 8px rgba(45, 91, 227, 0.30);
}

button[type="submit"]:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(45, 91, 227, 0.40);
  transform: translateY(-1px);
}

button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Remove bullet points (form errors / lists) ─────────── */
ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Placeholder text ───────────────────────────────────── */
input::placeholder,
select::placeholder {
  color: #b0ada6;
  font-size: 13px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .section {
    padding: 18px 16px;
  }

  body {
    padding: 24px 12px 60px;
  }

  button[type="submit"] {
    width: 100%;
    justify-content: center;
  }
}
