/* Accounts: header links, Log in / Sign up dialog, save box and the My history page. */

.account-links { display: inline-flex; align-items: center; gap: 0.75rem; margin-right: 0.75rem; }
.account-link {
  background: none; border: 0; padding: 0; font: inherit; font-size: 15.5px; font-weight: 600; color: #52687b;
  cursor: pointer; text-decoration: none;
}
.account-link:hover, .account-link:focus-visible { color: var(--teal-dark, #078a8a); }

/* header menus: "About MediRoute" and "My MediRoute" */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem;
  color: #52687b; font-size: 15.5px; font-weight: 600; white-space: nowrap;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after {
  content: ""; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .15s ease;
}
.nav-dropdown[open] > summary::after { transform: rotate(225deg) translateY(-1px); }
.nav-dropdown > summary:hover, .nav-dropdown[open] > summary { color: var(--teal-dark, #078a8a); }
.nav-dropdown > summary:focus-visible { outline: 2px solid var(--teal, #0ea5a4); outline-offset: 3px; border-radius: 4px; }
.nav-dropdown-panel {
  position: absolute; top: calc(100% + 0.6rem); left: 0; z-index: 50; min-width: 13rem;
  display: grid; padding: 0.4rem; border: 1px solid var(--line, #e4edf2); border-radius: 12px;
  background: var(--surface, #fff); box-shadow: var(--soft-shadow, 0 18px 50px rgba(14, 48, 74, .08));
}
.account-menu .nav-dropdown-panel { left: auto; right: 0; }
.nav-dropdown-panel a, .nav-dropdown-panel button {
  display: block; width: 100%; padding: 0.55rem 0.75rem; border: 0; border-radius: 8px; background: none;
  text-align: left; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink, #102a43); cursor: pointer;
}
.nav-dropdown-panel a:hover, .nav-dropdown-panel button:hover,
.nav-dropdown-panel a:focus-visible, .nav-dropdown-panel button:focus-visible { background: var(--background, #f7fafc); color: var(--teal-dark, #078a8a); }
.nav-dropdown-panel a[aria-current="page"] { color: var(--teal-dark, #078a8a); }
.account-who {
  display: block; padding: 0.35rem 0.75rem; color: var(--muted, #60758a); font-size: 0.85rem;
  max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-top: 1px solid var(--line, #e4edf2); margin-top: 0.25rem;
}
@media (max-width: 820px) {
  /* inside the phone menu the panels are plain lists, not floating boxes */
  .nav-dropdown-panel { position: static; box-shadow: none; border: 0; padding: 0.25rem 0 0 0.75rem; min-width: 0; }
  .nav-dropdown > summary { padding: 12px 0; }
  .account-links { margin-right: 0; }
}

.account-dialog {
  width: min(28rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto;
  border: 1px solid var(--line, #e4edf2); border-radius: 16px; padding: 1.5rem;
  background: var(--surface, #fff); color: var(--ink, #102a43); box-shadow: var(--soft-shadow, 0 18px 50px rgba(14, 48, 74, .08));
}
.account-dialog::backdrop { background: rgba(8, 30, 50, 0.45); }
.account-dialog h2 { margin: 0 0 0.25rem; font-family: var(--font-display, sans-serif); font-size: 1.35rem; }
.account-close { position: absolute; top: 0.75rem; right: 0.9rem; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted, #60758a); }
.account-intro { margin: 0 0 1rem; color: var(--muted, #60758a); font-size: 0.95rem; }
.account-tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line, #e4edf2); }
.account-tab { background: none; border: 0; padding: 0.5rem 0.75rem; font: inherit; font-weight: 600; color: var(--muted, #60758a); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.account-tab.is-active { color: var(--navy, #0b3b60); border-bottom-color: var(--teal, #0ea5a4); }
.account-form { display: grid; gap: 0.85rem; }
.account-form[hidden] { display: none; }
.account-field { display: grid; gap: 0.3rem; }
.account-label { font-weight: 600; font-size: 0.9rem; }
.account-field input, .account-field select {
  width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--line, #e4edf2); border-radius: 10px;
  font: inherit; background: var(--background, #f7fafc); color: inherit;
}
.account-field input:focus-visible, .account-field select:focus-visible { outline: 2px solid var(--teal, #0ea5a4); outline-offset: 1px; }
.account-hint { color: var(--muted, #60758a); font-size: 0.8rem; }
.account-consent { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; font-size: 0.85rem; color: var(--muted, #60758a); }
.account-consent input { margin-top: 0.2rem; }
.account-message { min-height: 1.2rem; margin: 0.75rem 0 0; color: #b42318; font-size: 0.9rem; }

/* save box on the hospital page */
.hp-save {
  display: grid; gap: 0.5rem; margin: 0.75rem 0 1rem; padding: 0.9rem 1rem;
  border: 1px dashed var(--line, #e4edf2); border-radius: 12px; background: var(--background, #f7fafc);
}
.hp-save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.hp-save-desc { display: inline-flex; gap: 0.4rem; align-items: center; font-size: 0.9rem; color: var(--muted, #60758a); }
.hp-save-status { margin: 0; font-size: 0.9rem; color: var(--muted, #60758a); }
.hp-save-status.is-ok { color: var(--teal-dark, #078a8a); font-weight: 600; }
.hp-save-status.is-error { color: #b42318; }

/* My history page */
.history-main { padding: 2rem 0 4rem; }
.history-container { width: min(60rem, calc(100% - 2rem)); margin: 0 auto; }
.history-container h1 { font-family: var(--font-display, sans-serif); margin: 0 0 0.25rem; }
.history-lead { color: var(--muted, #60758a); margin: 0 0 1.5rem; }
.history-empty, .history-login { padding: 2rem; border: 1px solid var(--line, #e4edf2); border-radius: 16px; background: var(--surface, #fff); text-align: center; }
.history-list { display: grid; gap: 0.75rem; list-style: none; padding: 0; margin: 0; }
.history-item {
  display: grid; gap: 0.35rem; padding: 1rem 1.1rem; border: 1px solid var(--line, #e4edf2); border-radius: 14px;
  background: var(--surface, #fff); cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
}
.history-item:hover, .history-item:focus-visible { border-color: var(--teal, #0ea5a4); }
.history-item[aria-expanded="true"] { border-color: var(--teal, #0ea5a4); box-shadow: var(--soft-shadow, none); }
.history-meta { color: var(--muted, #60758a); font-size: 0.85rem; }
.history-text { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-specialty { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; background: rgba(14, 165, 164, .12); color: var(--teal-dark, #078a8a); font-size: 0.82rem; font-weight: 600; }
.history-detail { padding: 1rem 1.1rem 1.25rem; border: 1px solid var(--line, #e4edf2); border-top: 0; border-radius: 0 0 14px 14px; margin-top: -0.75rem; background: var(--surface, #fff); }
.history-detail h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.history-thread { margin: 0; padding-left: 1.1rem; }
.history-thread li { margin-bottom: 0.4rem; }
.history-thread .q { color: var(--muted, #60758a); }
.history-hospitals { display: grid; gap: 0.6rem; }
.history-hospital { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.7rem 0.85rem; border: 1px solid var(--line, #e4edf2); border-radius: 10px; }
.history-hospital small { color: var(--muted, #60758a); display: block; }
.history-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.history-danger { color: #b42318 !important; }
.history-account { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line, #e4edf2); color: var(--muted, #60758a); font-size: 0.9rem; }
