﻿:root {
  --bg: #eef4ef;
  --surface: #f9fbfa;
  --brand: #078f46;
  --brand-2: #0a6b3d;
  --text: #1e3b2c;
  --muted: #577161;
  --line: #c8d9ce;
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}

.brand { margin: 0; font-size: 32px; color: var(--brand-2); }
.subtitle { margin: 6px 0 18px; color: var(--muted); }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
label { font-size: 13px; }

input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: 0;
}

select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: 0;
  background: #fff;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(7, 143, 70, 0.16);
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-soft {
  background: #69b48b;
  opacity: 1 !important;
}

.btn-outline {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.auth-links {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.register-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #dbe7de;
  overflow: hidden;
  margin-bottom: 12px;
}

.register-progress-fill {
  height: 100%;
  background: var(--brand);
  width: 33.333%;
}

.register-progress-fill.s1 { width: 33.333%; }
.register-progress-fill.s2 { width: 66.666%; }
.register-progress-fill.s3 { width: 100%; }

.register-title {
  margin: 0 0 12px;
  font-size: 16px;
}

.register-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.link-btn {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.alert {
  margin-bottom: 10px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 9px;
  font-size: 13px;
}

.portal {
  min-height: 100vh;
  max-width: 100vw;
  padding-top: 68px;
  padding-bottom: 88px;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 68px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.logo-shell { display: flex; align-items: center; justify-content: center; }
.logo-img { height: 36px; width: auto; object-fit: contain; }

.avatar {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 2px solid #d8f5e4;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar {
  width: 100%;
  padding: 12px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  width: 100%;
  margin-bottom: 4px;
}

.menu-link .mi {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-link .mi svg {
  width: 22px;
  height: 22px;
}

.menu-link span:last-child { white-space: nowrap; }
.menu-link.active { background: #d3e3d7; }

.content {
  width: 100%;
  padding: 8px 14px 22px;
}

.page {
  width: 100%;
}

.center-wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.center-wrap.narrow {
  max-width: 760px;
}

.title-hi {
  margin: 4px 0 16px;
  font-size: 32px;
  font-weight: 700;
}

.page-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
}

.page-sub {
  margin: 4px 0 14px;
  font-size: 16px;
  color: var(--text);
}

.page-sub.plain { margin-top: 0; }

.mid-title {
  text-align: center;
  margin: 10px 0 12px;
  font-size: 18px;
}

.breadcrumb {
  margin-bottom: 8px;
  font-size: 14px;
}

.service-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.service-card.clickable { cursor: pointer; }
.service-card.clickable:hover { box-shadow: 0 8px 24px rgba(18, 38, 89, 0.08); }

.service-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e7bf8e;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.service-card h4 {
  margin: 0;
  font-size: 18px;
}

.service-card p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #2b4b37;
}

.service-media {
  width: 100%;
  height: 120px;
  border-radius: 10px;
  background: #e9eef6;
  overflow: hidden;
}

.service-media.small {
  height: 76px;
}

.service-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}

.empty-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
  padding: 16px;
  font-size: 15px;
}

.progress-wrap {
  height: 10px;
  border-radius: 10px;
  background: #dbe7de;
  overflow: hidden;
  margin: 8px 0 18px;
}

.progress-fill { height: 100%; background: var(--brand); }
.progress-fill.w30 { width: 30%; }
.progress-fill.w75 { width: 75%; }

.ok-toast {
  background: #148448;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-weight: 600;
}

.pick-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px;
}

.pick-card h4 { margin: 0; font-size: 20px; }
.pick-card p { margin: 8px 0 12px; font-size: 16px; }

.terms-wrap { margin-bottom: 10px; }

.term-item {
  border: 1px solid #afc8b8;
  border-radius: 10px;
  background: transparent;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.term-item span:first-child {
  font-size: 16px;
  line-height: 1.35;
}

.term-item input { display: none; }

.term-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #aec7b7;
  background: transparent;
  flex-shrink: 0;
  position: relative;
}

.term-item input:checked + .term-check {
  background: var(--brand);
  border-color: var(--brand);
}

.term-item input:checked + .term-check::after {
  content: "✓";
  position: absolute;
  color: #fff;
  font-size: 14px;
  left: 6px;
  top: 2px;
}

.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 64px;
  border-radius: 999px;
  background: var(--brand);
  display: flex;
  align-items: center;
  padding: 7px;
  z-index: 50;
}

.bn-item {
  width: 50%;
  color: #fff;
  text-align: center;
  font-size: 14px;
  border-radius: 999px;
  padding: 11px 0;
  font-weight: 600;
}

.bn-item.active { background: var(--brand-2); }

.precall-layout {
  display: grid;
  gap: 16px;
}

.phone {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #d8e2ea;
  padding: 14px;
}

.phone-screen {
  background: #000;
  border-radius: 8px;
  min-height: 520px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 16px;
}

.phone-screen h3 { color: #fff; margin: 0; text-align: center; }

.meeting-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.code {
  margin: 8px 0 0;
  background: #0f172a;
  color: #d1d5db;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  overflow: auto;
}

.media-hint {
  margin: 0;
  color: #f8d9d9;
  text-align: center;
  font-size: 13px;
}

.media-ok {
  margin: 0;
  color: #cff7de;
  text-align: center;
  font-size: 13px;
}

.permission-card,
.queue-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 22px;
  text-align: center;
  display: grid;
  gap: 12px;
}

.permission-icon,
.queue-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 40px;
}

.permission-icon {
  background: #e8f0eb;
}

.queue-icon {
  background: #e8eff6;
}

.queue-card h2,
.permission-card h2 {
  margin: 0;
  font-size: 34px;
}

.queue-card h3 {
  margin: 6px 0 0;
  font-size: 42px;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 5px solid #dfe8e3;
  border-top-color: var(--brand);
  border-radius: 50%;
  margin: 8px auto 0;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.dependent-form {
  display: grid;
  gap: 10px;
}

.dependents-feedback {
  min-height: 20px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
}

.dependents-feedback.info { color: #1f6f4a; }
.dependents-feedback.success { color: #0f6b3d; }
.dependents-feedback.warn { color: #925800; }
.dependents-feedback.error { color: #991b1b; }

.dependents-list {
  display: grid;
  gap: 10px;
}

.dependent-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 3px;
}

.dependent-item strong {
  font-size: 16px;
}

.dependent-item span {
  font-size: 14px;
  color: #355745;
}

.consult-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.consult-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.consult-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.consult-date {
  font-size: 14px;
}

.consult-professional {
  font-size: 20px;
  font-weight: 700;
}

.consult-specialty,
.consult-id {
  font-size: 14px;
  color: #355745;
}

.consult-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.consult-status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.consult-status-done {
  background: #dcfce7;
  color: #166534;
}

.consult-status-scheduled {
  background: #dbeafe;
  color: #1d4ed8;
}

.consult-status-progress {
  background: #fef3c7;
  color: #92400e;
}

.consult-status-pending,
.consult-status-unknown {
  background: #e5e7eb;
  color: #374151;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
  display: grid;
  gap: 16px;
}

.account-avatar {
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3f8dff, #1f63d6);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 34px;
}

.account-grid { display: grid; gap: 12px; }
.account-grid div { display: grid; gap: 3px; }
.account-grid strong { font-size: 12px; color: #6b7c74; }
.account-grid span { font-size: 16px; }

@media (min-width: 920px) {
  .sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 88px;
    width: var(--sidebar-w);
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .menu-link {
    width: 100%;
    transform: none;
    font-size: 15px;
    margin-bottom: 2px;
  }

  .content {
    margin-left: var(--sidebar-w);
    padding: 20px 24px 26px;
  }

  .center-wrap { max-width: 980px; }
  .center-wrap.narrow { max-width: 760px; }
  .center-wrap,
  .center-wrap.narrow {
    margin-left: 0;
    margin-right: 0;
  }

  .title-hi { font-size: 42px; }
  .page-title { font-size: 42px; }
  .page-sub { font-size: 18px; }
  .mid-title { font-size: 36px; }

  .service-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    min-height: 118px;
  }

  .service-media {
    width: 340px;
    height: 108px;
  }

  .service-media.small {
    width: 220px;
    height: 76px;
  }

  .precall-layout {
    grid-template-columns: 340px 1fr;
    align-items: start;
  }

  .account-card {
    grid-template-columns: 220px 1fr;
    align-items: center;
    min-height: 240px;
  }

  .account-avatar {
    width: 170px;
    height: 170px;
    font-size: 48px;
    margin: 0 auto;
  }

  .account-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px 34px;
  }
}
