:root {
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  color: #163b3d;
  background: #f3f7f6;
  font-synthesis: none;
  --accent: #086d67;
  --muted: #5c7474;
  --line: #d7e4e1;
  --role-soft: #eaf5f2;
  --role-strong: #075a55;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  transition: background-color 160ms ease;
}
body.role-doctor {
  --accent: #086d67;
  --role-soft: #e5f4f0;
  --role-strong: #075a55;
  background: #f3f7f6;
}
body.role-patient {
  --accent: #315fa8;
  --role-soft: #eaf0fb;
  --role-strong: #244b87;
  background: #f5f7fc;
}
a {
  color: var(--accent);
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  min-height: 46px;
  padding: 11px 19px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.secondary {
  background: white;
  color: var(--accent);
  border-color: var(--line);
}
.danger {
  background: #a3323d;
  border-color: #a3323d;
}
.text-button {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
}
button:hover {
  filter: brightness(0.95);
}
:focus-visible {
  outline: 3px solid #ddab44;
  outline-offset: 3px;
}
.site-header {
  height: 88px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  background: #fff;
}
.brand {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -1px;
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
}
.local-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 7px 10px;
  background: #edf5f2;
  border-radius: 5px;
}
nav {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.nav-link {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--role-soft);
  border-color: var(--accent);
}
.user-identity {
  display: grid;
  gap: 1px;
  padding: 5px 13px;
  border-left: 1px solid var(--line);
}
.user-identity strong {
  color: var(--role-strong);
  font-size: 16px;
  line-height: 1.2;
}
.role-badge {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.brand-mark {
  color: var(--accent);
}
.role-doctor .site-header {
  border-top: 4px solid #086d67;
}
.role-patient .site-header {
  border-top: 4px solid #315fa8;
}
main {
  max-width: 1180px;
  margin: 42px auto;
  padding: 0 24px;
  min-height: 72vh;
}
h1 {
  font-size: 36px;
  letter-spacing: -1.2px;
  line-height: 1.15;
  margin: 10px 0 14px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 17px;
}
p {
  line-height: 1.6;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.8px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
}
.muted {
  color: var(--muted);
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.hero p {
  margin: 0;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 3px 6px #143b3510;
}
.auth-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 70px;
  align-items: center;
  max-width: 970px;
  margin: 70px auto;
}
.auth-copy h1 {
  font-size: 48px;
  max-width: 460px;
}
.auth-copy p {
  max-width: 400px;
  color: var(--muted);
}
.privacy-card {
  border-left: 3px solid #54a18d;
  padding: 10px 20px;
  margin-top: 32px;
}
.form {
  display: grid;
  gap: 18px;
}
.form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
input,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #b9ceca;
  border-radius: 7px;
  background: #fff;
  color: #183a3b;
  min-height: 46px;
}
.checkbox {
  display: flex !important;
  align-items: flex-start;
  font-weight: 400 !important;
  line-height: 1.5;
}
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.image-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #eef4f2;
  border-radius: 8px;
}
.image-card select {
  flex: 1;
  min-width: 150px;
}
.checkbox input {
  width: 20px;
  min-height: 20px;
  margin: 0 8px 0 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.stats {
  display: flex;
  gap: 40px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 25px;
  margin: 25px 0;
}
.stats strong {
  font-size: 30px;
  display: block;
}
.stats span {
  font-size: 13px;
  color: var(--muted);
}
.list {
  display: grid;
  gap: 12px;
}
.appointment {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: center;
}
.date-block {
  background: #eef6f3;
  border-radius: 8px;
  padding: 14px 8px;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
}
.date-block strong {
  display: block;
  font-size: 25px;
}
.appointment h3 {
  margin: 0 0 6px;
}
.appointment p {
  margin: 0;
  font-size: 14px;
}
.pill {
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 20px;
  background: #edf5f2;
  color: #296c58;
  display: inline-block;
}
.empty {
  text-align: center;
  padding: 65px 25px;
}
.narrow {
  max-width: 650px;
  margin: auto;
}
.error {
  color: #a3323d;
  min-height: 20px;
  font-size: 14px;
}
.banner {
  padding: 13px 18px;
  background: #e4f1ed;
  border: 1px solid #c5dfd5;
  border-radius: 8px;
  margin: 16px 0;
  line-height: 1.5;
}
.video-box {
  background: #122a2e;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  min-height: 250px;
}
.video-box video {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  display: block;
}
meter {
  width: 100%;
  height: 25px;
}
.call-stage {
  position: relative;
  background: #10292e;
  border-radius: 16px;
  overflow: hidden;
  height: min(68vh, 720px);
  min-height: 320px;
}
.call-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
}
.call-stage:fullscreen .local-video {
  width: min(22vw, 300px);
}
.remote {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.local-video {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 22%;
  max-width: 230px;
  min-width: 120px;
  border-radius: 10px;
  border: 2px solid #87c7b7;
  background: #1f4146;
}
.call-controls {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 18px;
  background: #202124d9;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px #0005;
}
.call-controls .call-control {
  min-width: 68px;
  min-height: 70px;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
}
.control-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #3c4043;
  transition:
    background-color 140ms ease,
    transform 140ms ease;
}
.control-icon svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}
.control-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}
.call-control:hover {
  filter: none;
}
.call-control:hover .control-icon {
  background: #565a5e;
  transform: translateY(-1px);
}
.call-control.control-off .control-icon {
  background: #a3323d;
}
.call-controls .leave-control .control-icon {
  width: 58px;
  border-radius: 24px;
  background: #d93025;
}
.call-controls .leave-control:hover .control-icon {
  background: #b3261e;
}
.call-controls .accept-control .control-icon {
  background: var(--accent);
}
.call-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.quality {
  font-size: 13px;
  color: var(--muted);
}
#notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 430px;
  z-index: 10;
  background: #173f3b;
  color: #fff;
  padding: 16px 24px;
  border-radius: 9px;
  box-shadow: 0 4px 20px #0002;
  display: none;
}
footer {
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.copy-box {
  word-break: break-all;
}
.hidden {
  display: none !important;
}
.otp-local-help {
  padding: 12px 14px;
  border: 1px solid #98b7df;
  border-radius: 8px;
  background: #edf4ff;
  color: #234b80;
  font-size: 14px;
}
.otp-code {
  padding: 18px;
  border: 2px dashed var(--accent);
  border-radius: 10px;
  background: var(--role-soft);
  color: var(--role-strong);
  text-align: center;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 3px;
}
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #102827b8;
}
.confirmation-dialog {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 24px 70px #0005;
}
.confirmation-dialog h2 {
  margin-top: 0;
  font-size: 25px;
}
.confirmation-dialog .dialog-actions {
  justify-content: flex-end;
  margin-top: 24px;
}
@media (max-width: 760px) {
  .auth-layout,
  .grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .auth-layout {
    margin: 20px auto;
  }
  .auth-copy h1 {
    font-size: 36px;
  }
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .site-header {
    height: auto;
    min-height: 88px;
    padding: 12px 20px;
    gap: 14px;
    flex-wrap: wrap;
  }
  .local-badge {
    display: none;
  }
  nav {
    width: 100%;
    order: 3;
    margin-left: 0;
  }
  .user-identity {
    margin-left: auto;
  }
  .appointment {
    grid-template-columns: 60px 1fr;
  }
  .appointment .row {
    grid-column: 2;
  }
  main {
    margin: 25px auto;
  }
  h1 {
    font-size: 30px;
  }
  .card {
    padding: 20px;
  }
  .call-controls {
    bottom: 10px;
    gap: 2px;
    padding: 8px;
    max-width: calc(100% - 16px);
  }
  .call-controls .call-control {
    min-width: 58px;
  }
  .control-icon {
    width: 42px;
    height: 42px;
  }
  .call-controls .leave-control .control-icon {
    width: 52px;
  }
  .local-video {
    width: 28%;
    min-width: 90px;
  }
  .call-stage {
    height: 55vh;
  }
  .stats {
    gap: 25px;
  }
}
