/*
  Rivoravian website styles
  - modern, clean, responsive
  - minimal HTML classes, consistent components
*/

:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #d9dee5;
  --text: #1f2a37;
  --muted: #4b5563;
  --fineprint: #6b7280;
  --shadow: none;
  --shadow-soft: none;
  --radius: 8px;
  --radius-sm: 6px;
  --max: 1120px;

  --brand-1: #0b3d91; /* deep blue */
  --brand-2: #0b3d91;
  --brand-3: #0b3d91;
  --ring: rgba(11, 61, 145, 0.22);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial,
    sans-serif;
  line-height: 1.6;
  background: var(--bg);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.container {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 160ms ease;
  z-index: 9999;
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.announcement-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--brand-1);
  color: #fff;
  border-bottom: 1px solid #062a60;
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}

.announcement-track {
  width: 100%;
  white-space: nowrap;
}

#announcement-content {
  display: inline-block;
  padding-left: 100%;
  animation: announcement-marquee 18s linear infinite;
}

@keyframes announcement-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.site-header {
  position: sticky;
  top: 36px;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.nav-main {
  flex: 0 0 auto;
}

.nav-account {
  flex: 0 0 auto;
}

.nav .btn,
.nav .account-text {
  width: 120px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 40px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.account-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.nav-links > a:not(.btn) {
  text-decoration: none;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: background 120ms ease, color 120ms ease;
}
.nav-links > a:not(.btn):hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn:hover {
  background: var(--surface-2);
  border-color: #c9d1dc;
}
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}
.btn-small {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.btn-primary {
  border-color: #083272;
  background: var(--brand-1);
  color: #fff;
}
.btn-primary:hover {
  background: #083272;
  border-color: #062a60;
}
.btn-ghost {
  background: var(--surface);
}

.hero {
  padding: 36px 0 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  margin: 0 0 16px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.6px;
}

.gradient-text {
  display: inline-block;
  color: var(--brand-1);
}

.lead {
  font-size: 18px;
  color: var(--muted);
  margin: 14px 0 0;
  max-width: 62ch;
}

.muted {
  color: var(--muted);
}

.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.stat {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 16px;
}
.stat-title {
  font-weight: 700;
}
.stat-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.section {
  padding: 54px 0;
}

.section-showcase {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.section-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fineprint);
}

h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.2px;
}

h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.1px;
}

p {
  margin: 12px 0 0;
}

.appointment-shell h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.1px;
}

.appointment-shell p,
.appointment-shell td,
.appointment-shell th,
.appointment-shell pre,
.appointment-shell .muted,
.appointment-shell .appointment-hint {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}

.appointment-shell pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.appointment-shell th {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.cards {
  list-style: none;
  padding: 18px 0 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cards > li {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: none;
}
.cards p {
  color: var(--muted);
  margin-top: 8px;
}

.cards-actions {
  margin-top: 16px;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 170px;
}

.action-card .btn {
  margin-top: auto;
  width: fit-content;
}

.info-strip {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
}

.timeline {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.timeline-item {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 16px 16px 16px;
}
.timeline-title {
  font-weight: 750;
  margin-top: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand-1);
  box-shadow: none;
}

.two-col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}

.panel,
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  overflow: hidden;
}

.checklist {
  list-style: none;
  padding: 14px 0 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.checklist li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--brand-1);
}

.contact-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 14px;
}

.form {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  font-weight: 650;
  margin-bottom: 6px;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
}

input::placeholder,
textarea::placeholder {
  color: #9aa3af;
}

input:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-color: rgba(11, 61, 145, 0.35);
}

.fineprint {
  margin-top: 2px;
  font-size: 13px;
  color: var(--fineprint);
}

.contact-card .divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 750;
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-links a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 120ms ease, color 120ms ease;
}
.footer-links a:not(.btn):hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Login page layout */
.page {
  padding: 54px 0 70px;
}

.auth {
  width: min(520px, 100%);
  margin: 0 auto;
}

/* Appointment pages */
.subpage-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.subpage-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.subpage-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subpage-links a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.subpage-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.appointment-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.appointment-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.appointment-form > * {
  min-width: 0;
}

.appointment-hint {
  color: var(--fineprint);
  font-size: 13px;
}

.appointment-error {
  color: #b91c1c;
  min-height: 20px;
}

.appointment-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 8px;
  margin-top: 10px;
}

.appointment-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.appointment-table th {
  background: var(--brand-1);
  color: #fff;
  border-bottom: none;
  padding: 10px 14px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.appointment-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.appointment-table tbody tr:last-child td {
  border-bottom: none;
}

.appointment-table tbody tr:hover {
  background: var(--surface-2);
}

.appointment-status-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Responsive */
@media (max-width: 920px) {
  .nav {
    flex-wrap: wrap;
    min-height: auto;
    padding: 10px 0;
    gap: 8px;
  }
  .nav-main,
  .nav-account {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .nav .btn,
  .nav .account-text {
    width: auto;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 36px;
  }
  .brand {
    width: 100%;
    text-align: center;
    font-size: 15px;
  }
  .hero h1 {
    font-size: 28px;
    letter-spacing: -0.5px;
  }
  .lead {
    font-size: 15px;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .timeline {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .appointment-filters {
    grid-template-columns: 1fr;
  }
  .appointment-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .appointment-shell {
    padding: 0 8px;
  }
  h2 {
    font-size: 22px;
  }
  .section {
    padding: 32px 0;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .footer-links {
    justify-content: center;
  }
}
