@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #1e3a5f;
  --primary-light: #2563a8;
  --primary-dark: #0f2d5e;
  --accent: #f97316;
  --accent-light: #fb923c;
  --bg: #f8faff;
  --surface: #ffffff;
  --surface-2: #eef3ff;
  --border: #dde4f0;
  --text: #0f172a;
  --text-muted: #475569;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(30,58,95,0.10);
  --shadow-lg: 0 8px 32px rgba(30,58,95,0.14);
  --radius: 12px;
  --radius-lg: 18px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  scrollbar-width: none;
}
body::-webkit-scrollbar { display: none; }

/* ── Accessibility ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Header ── */
header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 64px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
header h1 { line-height: 1; }
header h1 a {
  font-size: 1.2rem; font-weight: 700;
  color: var(--text); text-decoration: none; letter-spacing: 0.03em;
}
header h1 a span { color: var(--accent); }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  padding: 0.4rem 0.85rem; border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover { background: var(--surface-2); color: var(--accent); }

.menu-toggle { display: none; flex-direction: column; cursor: pointer; gap: 5px; }
.menu-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; display: block; }

@media (max-width: 768px) {
  header { padding: 0 1rem; }
  .menu-toggle { display: flex; }
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: #ffffff; padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg); gap: 2px;
  }
  .nav-links.active { display: flex; }
  .nav-links a { padding: 0.65rem 1rem; border-radius: 8px; width: 100%; }
}

/* ── Main ── */
main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ── Hero / Highlight ── */
.uts-qr-highlight {
  background: linear-gradient(135deg, #0f2d5e 0%, #1e3a5f 55%, #2563a8 100%);
  color: #fff; border-radius: var(--radius-lg);
  padding: 3rem 2rem; margin-bottom: 2rem;
  text-align: center; position: relative; overflow: hidden;
}
.uts-qr-highlight::after {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%; pointer-events: none;
}
.uts-qr-highlight h3 {
  font-size: 2rem; font-weight: 700;
  margin-bottom: 0.5rem; letter-spacing: -0.02em;
}
.uts-qr-highlight .slogan {
  font-size: 1.05rem; color: rgba(255,255,255,0.9);
  font-weight: 600; margin-bottom: 0.8rem;
}
.uts-qr-highlight p:last-child {
  color: rgba(255,255,255,0.75); max-width: 540px;
  margin: 0 auto; font-size: 0.95rem; line-height: 1.7;
}

/* ── Station Search ── */
.station-search {
  background: url('../images/train.jpeg') center/cover no-repeat;
  border-radius: var(--radius-lg); overflow: hidden;
  padding: 3rem 2rem; position: relative; margin-bottom: 2rem;
}
.station-search::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(15,45,94,0.88), rgba(30,58,95,0.80));
}
.station-search > * { position: relative; z-index: 1; }

.search-form { display: flex; flex-direction: column; max-width: 500px; }
.search-left h3 {
  color: #fff; font-size: 1.4rem; font-weight: 700;
  margin-bottom: 1rem; letter-spacing: -0.01em;
}
.station-search input {
  width: 100%; padding: 0.9rem 1.25rem;
  font-size: 1rem; font-family: inherit;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 50px; background: rgba(255,255,255,0.97);
  color: var(--text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}
.station-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.22);
}
.station-search input::placeholder { color: #999; }

#suggestions {
  list-style: none; background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  width: 100%; margin-top: -2px; max-height: 280px; overflow-y: auto;
}
#suggestions li {
  padding: 0.65rem 1.25rem; cursor: pointer;
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition); outline: none;
}
#suggestions li:last-child { border-bottom: none; }
#suggestions li:hover, #suggestions li:focus {
  background: var(--accent); color: #fff;
}
#suggestions li:hover .station-state,
#suggestions li:focus .station-state { color: rgba(255,255,255,0.8); }

.station-state {
  font-size: 0.78rem; color: var(--text-muted);
  font-style: italic; margin-top: 2px;
}
.search-divider { display: none; }

/* ── QR Display Block ── */
.uts-qr-block { max-width: 420px; margin: 0 auto 2rem; text-align: center; }
.uts-qr-title {
  font-size: 1.4rem; font-weight: 700;
  color: var(--primary); margin-bottom: 1rem;
}
.uts-qr-imgbox {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-md);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.uts-qr-image {
  width: 220px; max-width: 85vw;
  height: auto; border-radius: 8px; display: block;
}
.uts-qr-caption {
  color: var(--text-muted); font-size: 0.93rem; line-height: 1.6;
  background: var(--surface); padding: 0.75rem 1rem;
  border-radius: var(--radius); border-left: 3px solid var(--accent);
  text-align: left;
}

/* ── State Grid ── */
.uts-qr { margin-bottom: 2rem; }
.uts-qr h3 {
  text-align: center; color: var(--primary);
  font-size: 1.4rem; font-weight: 700;
  margin-bottom: 1.5rem; padding-bottom: 0.75rem; position: relative;
}
.uts-qr h3::after {
  content: ''; position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 48px; height: 3px;
  background: var(--accent); border-radius: 2px;
}
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}
.state-block {
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.state-block:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg), 0 0 0 2px rgba(249,115,22,0.22); }
.state-block a { display: block; }
.state-block img {
  width: 100%; height: 130px; object-fit: cover;
  display: block; background: #ddd;
}
.state-block p {
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--text); text-align: center; margin: 0;
}

/* ── FAQ Section ── */
.faq-section {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); margin-bottom: 2rem;
}
.faq-section h3 {
  text-align: center; color: var(--primary);
  font-size: 1.4rem; font-weight: 700;
  margin-bottom: 1.5rem; padding-bottom: 0.75rem; position: relative;
}
.faq-section h3::after {
  content: ''; position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 48px; height: 3px; background: var(--accent); border-radius: 2px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden;
}
.faq-item h4 {
  padding: 1rem 1.25rem; color: var(--primary);
  font-size: 0.93rem; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); user-select: none;
  transition: background var(--transition); margin: 0;
}
.faq-item h4::after {
  content: '+'; font-size: 1.3rem; color: var(--accent);
  font-weight: 300; flex-shrink: 0; margin-left: 1rem; line-height: 1;
}
.faq-item.open h4 { background: rgba(30,58,95,0.07); }
.faq-item.open h4::after { content: '−'; }
.faq-item p {
  padding: 0 1.25rem; color: var(--text-muted); font-size: 0.9rem;
  line-height: 1.75; max-height: 0; overflow: hidden;
  transition: max-height 0.38s ease, padding 0.38s ease;
}
.faq-item.open p { max-height: 400px; padding: 0.75rem 1.25rem 1.1rem; }

/* ── Page containers (About, History, Disclaimer) ── */
.page-container,
.about-container {
  max-width: 820px; margin: 0 auto;
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 2.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.page-container h2,
.about-container h2 {
  color: var(--primary); font-size: 1.7rem; font-weight: 700;
  text-align: center; margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-container h3,
.about-container h3,
.page-container .section h2,
.about-container .section h2 {
  color: var(--primary); font-size: 1.05rem; font-weight: 600;
  margin-top: 1.75rem; margin-bottom: 0.6rem;
  padding-left: 0.75rem; border-left: 3px solid var(--accent);
}
.page-container p,
.about-container p,
.page-container li,
.about-container li {
  color: var(--text-muted); line-height: 1.75; margin-bottom: 0.5rem;
}
.page-container ul,
.about-container ul { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.page-container a,
.about-container a { color: var(--primary-light); }
.page-container strong,
.about-container strong { color: var(--text); }

.note {
  background: #fff8ee; border: 1px solid #ffd88a;
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin-top: 1.5rem; color: #7a5300;
  font-size: 0.9rem; line-height: 1.6; font-style: normal;
}

/* ── Contact Form ── */
.contact-container {
  max-width: 600px; margin: 0 auto;
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 2.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.contact-container h2 {
  color: var(--primary); font-size: 1.7rem; font-weight: 700;
  text-align: center; margin-bottom: 0.4rem;
}
.contact-subtitle {
  text-align: center; color: var(--text-muted);
  font-size: 0.9rem; margin-bottom: 2rem;
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.875rem; font-weight: 600;
  color: var(--text); margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea {
  width: 100%; padding: 0.8rem 1rem;
  font-size: 0.95rem; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,43,92,0.08);
}
.form-group textarea { height: 120px; resize: vertical; }
.submit-btn {
  width: 100%; padding: 0.9rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; font-family: inherit;
  cursor: pointer; letter-spacing: 0.01em;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(234,88,12,0.30);
}
.submit-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(234,88,12,0.38); }
.submit-btn:active { transform: translateY(0); }
.error { color: #dc2626; font-size: 0.8rem; margin-top: 0.3rem; }

/* ── Station QR Page ── */
.station-qr-page {
  max-width: 480px; margin: 2rem auto;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 2.5rem 2rem 2rem;
  text-align: center; border: 1px solid var(--border);
}
.station-qr-page h2 {
  color: var(--primary); font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem;
}
.station-code-badge {
  display: inline-block; background: var(--accent);
  color: #fff; font-weight: 700; border-radius: 50px;
  padding: 4px 18px; font-size: 0.9rem; margin-bottom: 0.4rem;
  letter-spacing: 1.5px;
}
.station-qr-page .state-name { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0; }
.station-qr-page .uts-qr-imgbox { margin: 1.5rem auto; }
.station-qr-page .uts-qr-image { max-width: 260px; width: 100%; }
.station-qr-page .uts-qr-caption { font-size: 0.9rem; margin-top: 0; }

.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 1.75rem; color: var(--primary); text-decoration: none;
  font-weight: 600; font-size: 0.9rem;
  border: 2px solid var(--primary); border-radius: 50px;
  padding: 0.5rem 1.25rem;
  transition: background var(--transition), color var(--transition);
}
.back-link:hover { background: var(--primary); color: #fff; }
.error-msg { color: #dc2626; text-align: center; font-size: 1.05rem; margin: 3rem auto; }
.error-msg a { color: var(--primary); font-weight: 600; }

/* ── Footer ── */
footer {
  background: #0f2d5e; color: rgba(255,255,255,0.72);
  text-align: center; padding: 1.5rem 4rem;
  font-size: 0.875rem; position: relative; margin-top: 2rem;
}
footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
footer a:hover { text-decoration: underline; }
footer p { margin-bottom: 0.25rem; }
.back-to-top {
  position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; border: none; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(249,115,22,0.35); line-height: 1;
  transition: opacity var(--transition), transform var(--transition);
}
.back-to-top:hover { opacity: 0.88; transform: translateY(calc(-50% - 2px)); }

/* ── Responsive ── */
@media (max-width: 600px) {
  main { padding: 1.25rem 1rem; }
  .uts-qr-highlight { padding: 2rem 1.25rem; }
  .uts-qr-highlight h3 { font-size: 1.5rem; }
  .station-search { padding: 2.25rem 1.25rem; }
  .state-grid { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
  .state-block img { height: 100px; }
  .page-container, .about-container { padding: 1.5rem 1.25rem; }
  .contact-container { padding: 1.5rem 1.25rem; }
  .faq-section { padding: 1.5rem 1.25rem; }
  .station-qr-page { padding: 1.75rem 1.25rem; margin: 1rem auto; }
  footer { padding: 1.5rem 3.5rem 1.5rem 1.5rem; }
}
