/*
 * Modelled on Microsoft's own sign-in pages, since users go back and forth between this
 * guide and login.microsoftonline.com / Security info all session.
 */
:root {
  --page: #f2f2f2;
  --panel: #ffffff;
  --text: #1b1b1b;
  --muted: #605e5c;
  --line: #d2d0ce;
  --soft: #f3f2f1;
  --blue: #0067b8;
  --blue-hover: #005da6;
  --on-blue: #ffffff;
  --grey-btn: #cccccc;
  --grey-btn-hover: #bbbbbb;
  --warn-line: #d83b01;
  --warn-bg: #fdf3ee;
  --error: #a4262c;
  --focus: #000000;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #1b1b1b; --panel: #2b2b2b; --text: #ffffff; --muted: #c8c6c4; --line: #484644;
    --soft: #323130; --blue: #4ca2ff; --blue-hover: #6cb3ff; --on-blue: #000000;
    --grey-btn: #484644; --grey-btn-hover: #5a5856; --warn-line: #f7894a; --warn-bg: #3a2a20;
    --error: #f1707b; --focus: #ffffff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #1b1b1b; --panel: #2b2b2b; --text: #ffffff; --muted: #c8c6c4; --line: #484644;
  --soft: #323130; --blue: #4ca2ff; --blue-hover: #6cb3ff; --on-blue: #000000;
  --grey-btn: #484644; --grey-btn-hover: #5a5856; --warn-line: #f7894a; --warn-bg: #3a2a20;
  --error: #f1707b; --focus: #ffffff; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
}
#app { max-width: 600px; margin: 0 auto; padding: 0 0 32px; }
@media (min-width: 640px) { #app { padding-top: 40px; } }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 10; }

.card {
  background: var(--panel);
  padding: 24px 16px 28px;
}
@media (min-width: 640px) {
  .card { padding: 44px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
}

.brand { min-height: 36px; margin-bottom: 16px; }
.brand img { display: block; height: 36px; width: auto; max-width: 220px; object-fit: contain; object-position: left center; }
.brand-text { font-size: 17px; font-weight: 600; }

.progress { margin-bottom: 12px; }
.progress-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.progress-track { height: 2px; background: var(--line); }
.progress-fill { height: 2px; background: var(--blue); }

h1 { font-size: 24px; font-weight: 600; line-height: 1.3; margin: 0 0 16px; }
h1:focus { outline: none; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 14px; }
ol, ul { margin: 0 0 16px; padding-left: 24px; }
li { margin-bottom: 8px; }
a { color: var(--blue); }
a:hover { color: var(--blue-hover); }

.note { background: var(--soft); padding: 10px 12px; }
.note-warn { background: var(--warn-bg); border-left: 3px solid var(--warn-line); }
.hint { font-size: 14px; color: var(--muted); }
.banner { background: var(--warn-bg); border-left: 3px solid var(--warn-line); padding: 10px 12px; margin: 0 0 12px; }

.shot { margin: 0 0 16px; }
.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }
.shot-placeholder {
  min-height: 140px; background: var(--soft); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 16px; color: var(--muted); font-size: 14px;
}
.shot-label { font-weight: 600; }
.shot-phone img { width: auto; max-width: 100%; max-height: 460px; }
.shot .credit { font-size: 12px; color: var(--muted); margin-top: 4px; }
.shot .credit a { color: var(--muted); }
.chooser { margin: 0 0 16px; border-top: 1px solid var(--line); }
.chooser-item { border-bottom: 1px solid var(--line); }
.chooser-option {
  display: flex; align-items: center; width: 100%; min-height: 48px; padding: 12px 12px 12px 36px;
  background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; position: relative;
}
.chooser-option::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border: 2px solid var(--muted); border-radius: 50%; box-sizing: border-box;
}
.chooser-item.open .chooser-option { font-weight: 600; }
.chooser-item.open .chooser-option::before { border-color: var(--blue); background: radial-gradient(var(--blue) 0 3px, transparent 4px); }
.chooser-option:hover { background: var(--soft); }
.chooser-panel { padding: 4px 12px 16px 36px; }
.chooser-panel .shot { max-width: 320px; margin-bottom: 12px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; margin: 0 0 16px; }
.gallery .shot { margin: 0; display: flex; flex-direction: column; }
.gallery .shot img { width: 100%; }
.gallery .shot-placeholder { aspect-ratio: 5 / 7; min-height: 0; justify-content: flex-end; }
.gallery .shot-placeholder > span:not(.shot-label) { display: none; }
.gallery figcaption { font-size: 14px; font-weight: 600; margin-top: 6px; color: var(--text); }

/* buttons — Microsoft sign-in style: square, solid blue primary, grey secondary */
.button {
  font: inherit; font-size: 15px; min-height: 44px; min-width: 108px; padding: 8px 16px;
  border: 1px solid transparent; border-radius: 0; cursor: pointer; text-align: center;
}
.button-primary { background: var(--blue); color: var(--on-blue); }
.button-primary:hover { background: var(--blue-hover); }
.button-secondary { background: var(--grey-btn); color: var(--text); }
.button-secondary:hover { background: var(--grey-btn-hover); }
.button-link { background: none; color: var(--blue); min-width: 0; padding: 8px 0; text-decoration: underline; }
.button[disabled] { opacity: .6; cursor: default; }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.actions .button { width: 100%; }
@media (min-width: 640px) {
  .actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .actions .button { width: auto; }
}
.link-button {
  display: inline-block; min-height: 44px; padding: 10px 16px; border: 1px solid var(--blue);
  color: var(--blue); text-decoration: none; font-weight: 600;
}
.link-button:hover { background: var(--soft); }
.link-row { margin-bottom: 4px; }
.link-return { margin: 0 0 16px; }

/* pickers — list rows like Microsoft's "Sign-in options" */
.picker { border: 0; margin: 0 0 20px; padding: 0; }
.picker legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.option { position: relative; border-bottom: 1px solid var(--line); }
.option:first-of-type { border-top: 1px solid var(--line); }
.option input { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.option label { display: block; padding: 12px 12px 12px 42px; min-height: 48px; cursor: pointer; }
.option:hover { background: var(--soft); }
.option input:checked + label { font-weight: 600; }
.detected { margin: 6px 0 0; }
.field-error { color: var(--error); font-size: 14px; margin: 6px 0 0; }
.field-error:empty { display: none; }

/* Bitwarden test */
.test-box { margin: 0 0 8px; }
.test-box .hint { margin-top: 8px; }

/* help form */
.help-form { margin: 0 0 20px; }
.help-form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.help-form textarea, .help-form input[type=file] {
  width: 100%; font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 0; padding: 8px;
}
.help-form textarea:focus { border-color: var(--blue); }
.help-form .hint { margin: 4px 0 0; }

/* contact */
.contact { border-top: 1px solid var(--line); padding-top: 16px; margin: 20px 0 16px; }
.contact dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.contact dt { color: var(--muted); }
.contact dd { margin: 0; overflow-wrap: anywhere; }

/* having trouble */
.trouble { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 16px; }
.trouble details { border-bottom: 1px solid var(--line); }
.trouble summary { cursor: pointer; padding: 10px 0; min-height: 44px; }
.trouble details p { margin: 0 0 12px; }

/* technician checklist */
.tech-step { margin-top: 20px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--blue); }

.footer { display: flex; justify-content: flex-end; gap: 16px; padding: 12px 16px; }
.footer-link { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.footer-link:hover { text-decoration: underline; color: var(--text); }
