/* ===========================================
   VIDHAN SABHA PLATFORM — STYLES
   Aesthetic: refined editorial / official
   Palette: parchment, ink, deep navy, saffron accent
   =========================================== */

:root {
  --paper: #f6f1e8;
  --paper-2: #efe7d7;
  --paper-line: #e3d9c4;
  --ink: #1a1a17;
  --ink-soft: #4a463e;
  --ink-mute: #87827a;
  --navy: #14233f;
  --navy-soft: #1f3357;
  --saffron: #c8541e;
  --saffron-soft: #e07a3f;
  --gold: #b08a3e;
  --green: #1e6b4a;
  --line: #d4c9b1;
  --line-soft: #e8dfc9;
  --white: #ffffff;
  --shadow-sm: 0 1px 0 rgba(20, 35, 63, 0.04), 0 1px 2px rgba(20, 35, 63, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 35, 63, 0.06), 0 1px 3px rgba(20, 35, 63, 0.04);
  --shadow-lg: 0 12px 36px rgba(20, 35, 63, 0.08), 0 4px 10px rgba(20, 35, 63, 0.04);

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper texture using layered gradients */
body {
  background-image:
    radial-gradient(circle at 20% 10%, rgba(200, 84, 30, 0.04), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(20, 35, 63, 0.04), transparent 40%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 40px,
      rgba(20, 35, 63, 0.015) 40px,
      rgba(20, 35, 63, 0.015) 41px
    );
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ===== ORNAMENT BAR ===== */
.ornament-bar {
  display: flex;
  height: 4px;
  width: 100%;
}
.ornament-stripe { flex: 1; }
.ornament-stripe.saffron { background: var(--saffron); }
.ornament-stripe.white { background: #f4f4f4; }
.ornament-stripe.green { background: var(--green); }

/* ===== HEADER ===== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.92);
}

.emblem {
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--navy);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--paper);
  flex-shrink: 0;
}
.emblem svg { width: 36px; height: 36px; }

.header-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.15rem 0;
  font-weight: 500;
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.01em;
  font-style: italic;
}

.datetime-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.datetime-pill .dot { color: var(--ink-mute); }
.datetime-pill i { color: var(--saffron); }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--navy);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--saffron);
  box-shadow: 0 0 0 3px rgba(200, 84, 30, 0.25);
  animation: pulse-dot 2.5s infinite;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font-body);
}
.logout-btn:hover {
  background: var(--saffron);
  border-color: var(--saffron);
  color: #fff;
}
.logout-btn i { font-size: 0.95rem; }

@media (max-width: 575px) {
  .logout-btn span { display: none; }
  .logout-btn { padding: 0.45rem 0.6rem; }
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(200, 84, 30, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(200, 84, 30, 0.05); }
}

/* ===== SECTION INTRO ===== */
.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  font-weight: 600;
  margin-bottom: 1rem;
}
.section-eyebrow .line {
  height: 1px;
  width: 36px;
  background: var(--saffron);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 500;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 1rem 0;
  letter-spacing: -0.02em;
}
.section-title em {
  font-style: italic;
  color: var(--saffron);
  font-weight: 500;
}
.section-title .period { color: var(--saffron); }

.section-sub {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 600px;
  margin: 0;
  line-height: 1.6;
}

.info-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.info-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 0.88rem;
}
.info-card-row:last-child { border-bottom: none; }
.info-card-row span {
  color: var(--ink-mute);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.info-card-row strong {
  color: var(--ink);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.status-active {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--green) !important;
  font-family: var(--font-body) !important;
}
.status-active .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s infinite;
}

/* ===== FORM CARD ===== */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  margin-bottom: 5rem;
}
.form-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--saffron) 0%,
    var(--saffron) 33%,
    #d4c9b1 33%,
    #d4c9b1 66%,
    var(--green) 66%,
    var(--green) 100%
  );
  border-radius: 0 0 2px 2px;
}

@media (min-width: 992px) {
  .form-card { padding: 3rem 3rem; }
}

.column-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}
.column-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--saffron);
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* ===== FIELDS ===== */
.field {
  margin-bottom: 1.25rem;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.field-label .optional {
  text-transform: none;
  font-weight: 400;
  color: var(--ink-mute);
  font-size: 0.75rem;
  letter-spacing: 0;
}

.field-input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.75rem 0.95rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  transition: all 0.18s ease;
  box-shadow: none;
}
.field-input::placeholder {
  color: var(--ink-mute);
  font-style: italic;
  font-size: 0.9rem;
}
.field-input:hover {
  border-color: var(--ink-mute);
  background: var(--white);
}
.field-input:focus {
  outline: none;
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(20, 35, 63, 0.08);
}

.field-textarea { resize: vertical; min-height: 90px; }
.queries-area { min-height: 120px; }

/* locked / readonly field — for fixed values like 'Bihar' */
.field-locked {
  background: var(--paper-2) !important;
  color: var(--ink) !important;
  font-weight: 600;
  cursor: not-allowed;
  border-color: var(--line) !important;
}
.field-locked:hover,
.field-locked:focus {
  background: var(--paper-2) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

.field-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: 0.35rem;
  font-style: italic;
}
.field-hint i {
  color: var(--saffron);
  font-style: normal;
  font-size: 0.7rem;
}

/* select */
select.field-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2387827a'%3e%3cpath d='M8 11L3 6h10z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px;
  padding-right: 2.4rem;
}

/* date input */
input[type="date"].field-input {
  font-family: var(--font-body);
}

/* mobile prefix */
.input-with-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  overflow: hidden;
  transition: all 0.18s ease;
}
.input-with-prefix:focus-within {
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(20, 35, 63, 0.08);
}
.input-with-prefix .prefix {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border-right: 1px solid var(--line);
}
.input-with-prefix .field-input {
  border: none;
  background: transparent;
  flex: 1;
}
.input-with-prefix .field-input:focus { box-shadow: none; }

/* validation states */
.field-input.is-invalid,
.was-validated .field-input:invalid {
  border-color: #c43d3d !important;
  background-image: none;
  padding-right: 0.95rem;
}
select.field-input.is-invalid,
.was-validated select.field-input:invalid {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2387827a'%3e%3cpath d='M8 11L3 6h10z'/%3e%3c/svg%3e");
  padding-right: 2.4rem;
}
.invalid-feedback {
  font-size: 0.78rem;
  color: #c43d3d;
  margin-top: 0.3rem;
}

.char-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-mute);
  text-align: right;
  margin-top: 0.35rem;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
  border-top: 1px solid var(--line-soft);
  padding-top: 1.75rem;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  max-width: 480px;
}
.consent .form-check-input {
  margin-top: 0.2rem;
  border-color: var(--ink-mute);
  border-radius: 2px;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}
.consent .form-check-input:checked {
  background-color: var(--navy);
  border-color: var(--navy);
}
.consent label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  cursor: pointer;
}

/* buttons */
.btn-primary-vs {
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary-vs:hover {
  background: var(--saffron);
  border-color: var(--saffron);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 84, 30, 0.25);
}
.btn-primary-vs i {
  transition: transform 0.2s ease;
}
.btn-primary-vs:hover i {
  transform: translateX(3px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 0.7rem 1.4rem;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}
.btn-ghost:hover {
  background: var(--paper);
  border-color: var(--ink-mute);
  color: var(--ink);
}

/* ===== ROLE SECTION ===== */
.role-section {
  margin-bottom: 4rem;
}
.role-section-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.role-section-header .section-eyebrow {
  justify-content: center;
}
.role-section-header .section-sub {
  margin: 0 auto;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

@media (max-width: 1199px) {
  .role-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .role-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}
@media (max-width: 479px) {
  .role-grid { grid-template-columns: 1fr; }
}

.role-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1.5rem 1.25rem;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}
.role-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ink-mute);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.role-card:hover {
  transform: translateY(-4px);
  border-color: var(--navy);
  box-shadow: var(--shadow-lg);
}
.role-card:hover::after {
  transform: scaleX(1);
  background: var(--saffron);
}
.role-card.featured {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.role-card.featured .role-num,
.role-card.featured .role-tag,
.role-card.featured .role-desc,
.role-card.featured .role-card-foot {
  color: rgba(255, 255, 255, 0.7);
}
.role-card.featured .role-title { color: #fff; }
.role-card.featured::after { background: var(--saffron); transform: scaleX(1); }

.role-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.role-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--saffron);
  line-height: 1;
}
.role-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  background: var(--paper);
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
}
.role-card.featured .role-tag {
  background: rgba(255, 255, 255, 0.1);
}

.role-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}
.role-desc {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
  min-height: 2.5em;
}
.role-card-foot {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line-soft);
}
.role-card.featured .role-card-foot {
  border-top-color: rgba(255, 255, 255, 0.15);
}
.role-card-foot i {
  color: var(--saffron);
  font-size: 0.95rem;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.85);
  padding: 2.5rem 0 2rem 0;
  margin-top: 2rem;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--saffron) 0%,
    var(--saffron) 33%,
    #f4f4f4 33%,
    #f4f4f4 66%,
    var(--green) 66%,
    var(--green) 100%
  );
}
.footer-brand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  font-weight: 500;
  color: #fff;
  margin: 0 0 0.25rem 0;
}
.footer-note {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}
.footer-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-family: var(--font-mono);
}
.footer-meta.small-meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.3rem;
}

/* ===== TOAST ===== */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vs-toast {
  background: var(--ink);
  color: #fff;
  padding: 0.85rem 1.1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease forwards;
  max-width: 340px;
}
.vs-toast.error { background: #8b2c2c; }
.vs-toast i { color: var(--saffron); font-size: 1.1rem; }
.vs-toast.error i { color: #ffb4b4; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== MODAL ===== */
.vs-modal {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.vs-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--saffron) 0%,
    var(--saffron) 33%,
    var(--paper-2) 33%,
    var(--paper-2) 66%,
    var(--green) 66%,
    var(--green) 100%
  );
}
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem auto;
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes pop-in {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.vs-modal h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--ink);
}
.ref-no {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--saffron);
  margin: 0 0 1rem 0;
  letter-spacing: 0.05em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .form-card { padding: 1.75rem 1.25rem; }
  .header-title { font-size: 1.3rem; }
  .form-actions { flex-direction: column; align-items: flex-start; }
  .form-actions > div:last-child { width: 100%; }
  .form-actions .btn-primary-vs { flex: 1; justify-content: center; }
}
@media (max-width: 575px) {
  .site-header { padding: 0.85rem 0; }
  .emblem { width: 44px; height: 44px; }
  .emblem svg { width: 30px; height: 30px; }
  .header-title { font-size: 1.15rem; }
  .header-eyebrow { font-size: 0.62rem; }
  .datetime-pill { font-size: 0.7rem; padding: 0.4rem 0.7rem; }
  .role-badge { font-size: 0.72rem; padding: 0.4rem 0.8rem; }
  .form-card { padding: 1.25rem 1rem; }
  .column-title { font-size: 1.15rem; }
  .role-card { padding: 1.25rem 1rem; }
  .role-num { font-size: 1.8rem; }
  .role-title { font-size: 1.2rem; }
}

/* ===== ENTRANCE ANIMATIONS ===== */
.section-intro,
.form-card,
.role-section {
  animation: fade-up 0.6s ease forwards;
  opacity: 0;
}
.section-intro { animation-delay: 0.1s; }
.form-card { animation-delay: 0.2s; }
.role-section { animation-delay: 0.3s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
