:root {
  --bg: #f4efe6;
  --bg-strong: #e8decd;
  --surface: rgba(255, 250, 243, 0.88);
  --surface-strong: #fffaf3;
  --card: rgba(255, 255, 255, 0.9);
  --ink: #162028;
  --muted: #54606a;
  --line: rgba(22, 32, 40, 0.1);
  --primary: #006d77;
  --primary-strong: #004f56;
  --accent: #ef8354;
  --success: #2a9d62;
  --danger: #b42318;
  --shadow: 0 22px 60px rgba(31, 41, 55, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1180px;
  --transition: 180ms ease;
  font-family: Bahnschrift, "Trebuchet MS", "Segoe UI Variable Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(0, 109, 119, 0.16), transparent 22%),
    radial-gradient(circle at bottom right, rgba(239, 131, 84, 0.18), transparent 18%),
    linear-gradient(180deg, #fbf8f2 0%, #f3ecdf 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.shell {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(251, 248, 242, 0.82);
  border-bottom: 1px solid rgba(22, 32, 40, 0.08);
}

.site-header__inner,
.footer__inner {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--primary), #2f9e9f);
  box-shadow: 0 12px 30px rgba(0, 109, 119, 0.25);
}

.brand__text strong,
.brand__text span {
  display: block;
}

.brand__text span {
  color: var(--muted);
  font-size: 0.88rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--ink);
}

.button,
.button-secondary,
.button-ghost,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 16px 30px rgba(0, 109, 119, 0.24);
}

.button-secondary {
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(22, 32, 40, 0.1);
}

.button-ghost {
  color: var(--primary-strong);
  background: rgba(0, 109, 119, 0.08);
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #cf5f4b, var(--danger));
}

.button:hover,
.button-secondary:hover,
.button-ghost:hover,
.button-danger:hover {
  transform: translateY(-1px);
}

.hero {
  padding: 54px 0 28px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 430px);
  gap: 28px;
  align-items: stretch;
}

.panel,
.metric,
.timeline-item,
.filter-card,
.form-card,
.empty-state,
.auth-card,
.feature-card,
.step-card,
.preview-card,
.footer-card,
.document-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 36px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(245, 239, 230, 0.75)),
    linear-gradient(135deg, rgba(0, 109, 119, 0.18), rgba(239, 131, 84, 0.12));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: rgba(0, 109, 119, 0.1);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero-copy h1,
.auth-card h1 {
  margin: 18px 0 14px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-copy p,
.auth-card__intro,
.section-copy {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
}

.hero-bullets,
.feature-grid,
.step-grid,
.preview-grid,
.metrics-grid,
.documents-grid,
.timeline,
.quick-actions,
.auth-links {
  display: grid;
  gap: 16px;
}

.hero-bullets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 26px;
}

.hero-bullets article,
.feature-card,
.step-card,
.preview-card,
.metric,
.document-card {
  padding: 18px;
}

.hero-bullets strong,
.metric strong,
.timeline-item__title,
.document-card strong {
  display: block;
  margin-bottom: 6px;
}

.hero-side {
  padding: 28px;
  display: grid;
  gap: 18px;
  background: linear-gradient(180deg, rgba(0, 109, 119, 0.92), rgba(0, 79, 86, 0.94));
  color: #f8f6f2;
}

.hero-side h2,
.preview-card h3,
.form-card h3,
.filter-card h3,
.auth-card h2 {
  margin: 0;
}

.hero-side__list,
.preview-card ul,
.step-card ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(248, 246, 242, 0.84);
  line-height: 1.7;
}

.hero-side__credentials {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
}

.section {
  padding: 28px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2,
.dashboard-header h1,
.auth-card h1,
.auth-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.feature-grid,
.step-grid,
.preview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 38px;
}

.dashboard-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.dashboard-subtitle {
  color: var(--muted);
  margin-top: 8px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 0.92rem;
}

.metric strong {
  font-size: 2rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 310px) minmax(0, 1fr);
  gap: 22px;
}

.dashboard-sidebar,
.dashboard-content {
  display: grid;
  gap: 18px;
  align-content: start;
}

.filter-card,
.form-card,
.preview-card,
.timeline-item,
.empty-state {
  padding: 22px;
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 32, 40, 0.14);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

textarea {
  min-height: 128px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: rgba(0, 109, 119, 0.6);
  box-shadow: 0 0 0 4px rgba(0, 109, 119, 0.12);
  background: #fff;
}

input[type="file"] {
  padding: 10px;
}

.form-hint,
.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.alert {
  display: none;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.alert.show {
  display: block;
}

.alert.success {
  border-color: rgba(42, 157, 98, 0.22);
  background: rgba(42, 157, 98, 0.12);
  color: var(--success);
}

.inline-actions,
.card-actions,
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-grid {
  margin-bottom: 12px;
}

.timeline {
  margin-top: 18px;
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.timeline-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.timeline-item__meta,
.document-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.consulta {
  color: #915f00;
  background: rgba(255, 210, 118, 0.35);
}

.badge.exame {
  color: var(--primary-strong);
  background: rgba(0, 109, 119, 0.14);
}

.badge.upload {
  color: #6c2e94;
  background: rgba(166, 113, 255, 0.16);
}

.documents-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(520px, 100%);
  padding: 32px;
}

.auth-card--wide {
  width: min(620px, 100%);
}

.auth-card__actions {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.auth-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.auth-links a {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0, 109, 119, 0.08);
  color: var(--primary-strong);
  text-align: center;
  font-weight: 700;
}

.footer {
  padding: 24px 0 40px;
}

.footer-card {
  padding: 20px 22px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .hero__grid,
  .dashboard-layout,
  .metrics-grid,
  .feature-grid,
  .step-grid,
  .preview-grid,
  .documents-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .hero-copy,
  .hero-side,
  .auth-card,
  .filter-card,
  .form-card,
  .preview-card,
  .timeline-item,
  .empty-state,
  .footer-card {
    padding: 20px;
  }

  .hero__grid,
  .hero-bullets,
  .feature-grid,
  .step-grid,
  .preview-grid,
  .metrics-grid,
  .quick-actions,
  .documents-grid,
  .auth-links,
  .form-row {
    grid-template-columns: 1fr;
  }

  .section-head,
  .dashboard-header,
  .site-header__inner {
    align-items: start;
    flex-direction: column;
  }
}
