:root {
  color-scheme: light;
  --fas-blue: #255979;
  --fas-blue-dark: #19435e;
  --ink: #182c39;
  --muted: #526774;
  --line: #d6e0e5;
  --surface: #ffffff;
  --page: #f4f7f8;
  --error: #9c3129;
  --focus: #126eaa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--page);
  line-height: 1.55;
}

button, select { font: inherit; }

.site-header {
  min-height: 76px;
  padding: 16px max(24px, calc((100vw - 1080px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { display: block; width: 202px; height: 40px; object-fit: contain; }
.header-label { margin: 0; color: var(--muted); font-size: .9rem; font-weight: 600; }

.main-content {
  width: min(100% - 40px, 780px);
  margin: 64px auto 80px;
  flex: 1;
}

.intro { max-width: 660px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: var(--fas-blue); font-size: .76rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 2.7rem); line-height: 1.15; letter-spacing: -.035em; }
.intro-copy { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 1.08rem; }

.panel {
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 5px 20px rgb(24 44 57 / 4%);
}

.sign-in-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.panel h2 { margin-bottom: 8px; font-size: 1.35rem; line-height: 1.3; }
.panel-copy { max-width: 480px; }
.panel-copy p { margin: 0; color: var(--muted); }
.dashboard-panel[hidden], .sign-in-panel[hidden] { display: none; }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.dashboard-heading .eyebrow { margin-bottom: 4px; }
.dashboard-heading h2 { margin: 0; font-size: 1.55rem; }

.field-group label { display: block; margin-bottom: 8px; font-size: .95rem; font-weight: 700; }
.select-row { display: flex; gap: 10px; }
select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 40px 10px 13px;
  color: var(--ink);
  border: 1px solid #9dafb9;
  border-radius: 5px;
  background-color: white;
}
select:disabled { color: #687b86; background-color: #f1f4f5; }

.button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.button:focus-visible, select:focus-visible, .brand:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.button-primary { color: #fff; background: var(--fas-blue); }
.button-primary:hover:not(:disabled) { background: var(--fas-blue-dark); }
.button-secondary { color: var(--fas-blue-dark); background: #fff; border-color: #a9bbc4; }
.button-secondary:hover:not(:disabled) { background: #f0f5f7; border-color: var(--fas-blue); }
.button:disabled { cursor: not-allowed; opacity: .58; }

.action-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; }
.action-hint { margin: 0; color: var(--muted); font-size: .9rem; }
.operation-status { min-height: 1.55em; margin: 18px 0 0; color: var(--fas-blue-dark); font-weight: 650; }
.notice { margin: 0 0 18px; padding: 13px 16px; border: 1px solid #afcbd9; border-radius: 6px; color: #173f59; background: #edf6fa; }
.notice-error { border-color: #e5bbb7; color: var(--error); background: #fff4f2; }

.confirm-dialog { width: min(100% - 32px, 470px); padding: 0; border: 0; border-radius: 10px; color: var(--ink); box-shadow: 0 18px 60px rgb(10 30 40 / 25%); }
.confirm-dialog::backdrop { background: rgb(10 25 35 / 55%); }
.dialog-content { padding: 30px; }
.dialog-content h2 { margin-bottom: 10px; font-size: 1.5rem; }
.dialog-content p:not(.eyebrow) { margin-bottom: 10px; color: var(--muted); }
.dialog-content .confirm-hostname { margin: 0 0 24px; padding: 11px 13px; overflow-wrap: anywhere; border-radius: 5px; color: var(--ink); background: #f0f4f6; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.site-footer {
  width: min(100% - 40px, 1080px);
  margin: 0 auto;
  padding: 20px 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #657985;
  border-top: 1px solid var(--line);
  font-size: .82rem;
}

.site-footer a { color: var(--fas-blue); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--fas-blue-dark); }
.site-footer a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (max-width: 560px) {
  .site-header { min-height: 68px; padding: 12px 18px; }
  .brand img { width: 170px; height: auto; }
  .header-label { max-width: 100px; text-align: right; font-size: .8rem; }
  .main-content { width: min(100% - 32px, 780px); margin-top: 42px; }
  .sign-in-panel, .action-row { align-items: stretch; flex-direction: column; }
  .sign-in-panel .button, .action-row .button { width: 100%; }
  .select-row { flex-direction: column; }
  .dashboard-heading { align-items: flex-start; }
  .site-footer { width: min(100% - 32px, 1080px); flex-direction: column; gap: 4px; }
  .dialog-content { padding: 24px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
