/* Colours and sizes from the mock-ups. System fonts: the page loads nothing from other hosts. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --subtle: #f7f8fa;
  --border: #e1e4ea;
  --border-strong: #d3d7de;
  --input-border: #c4c9d2;
  --text: #16181d;
  --text-2: #2b303a;
  --lead: #454b57;
  --muted: #5b6270;
  --accent: #2448b8;
  --accent-hover: #1a3590;
  --accent-soft: #eaf0ff;
  --ok: #0e6b45;
  --ok-soft: #e3f4ec;
  --warn: #8a5a00;
  --warn-text: #5c3d00;
  --warn-soft: #fff6e5;
  --danger: #b42318;
  --danger-hover: #912018;
  --neutral-soft: #f0f1f4;
  --radius: 12px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1 { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 600; }
h1:focus { outline: none; }
h2 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
strong { font-weight: 600; }

/* Header and footer */
.top {
  min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 40px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo {
  width: 96px; height: 28px; border: 1px dashed #9aa1ad; border-radius: 4px; display: flex;
  align-items: center; justify-content: center; font-size: 11px; color: var(--muted); letter-spacing: 0.04em;
}
.brand-name { font-size: 15px; font-weight: 500; color: #3a404b; }
.user { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.user-name { color: var(--lead); overflow-wrap: anywhere; }
.foot { height: 56px; display: flex; align-items: center; justify-content: center; gap: 24px; font-size: 13px; }
.foot a { color: var(--muted); }

main { flex-grow: 1; display: flex; justify-content: center; align-items: flex-start; padding: 48px 40px; }

/* Cards and layout */
.card {
  width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 48px; display: flex; flex-direction: column; gap: 24px;
}
.card-wide { max-width: 640px; padding: 40px 48px; gap: 28px; }
.wide { width: 100%; max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.stack-xs { display: flex; flex-direction: column; gap: 8px; }
.stack-xxs { display: flex; flex-direction: column; gap: 4px; }
.lead { font-size: 16px; line-height: 1.55; color: var(--lead); }
.note { font-size: 14px; line-height: 1.5; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }

.badge { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-neutral { background: var(--neutral-soft); color: #3a404b; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-radius: 50%; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

.panel {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; background: var(--subtle);
  border-radius: 8px; font-size: 14px; line-height: 1.5; color: var(--lead);
}
.panel strong { color: var(--text-2); }
.panel-row { flex-direction: row; align-items: center; gap: 12px; color: var(--text-2); }
.panel-warn { background: var(--warn-soft); color: var(--warn-text); }
.panel-warn strong { color: var(--warn-text); }
.info { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--lead); }
.info svg { flex-shrink: 0; margin-top: 2px; color: var(--muted); }

/* Buttons */
.btn {
  min-height: 48px; padding: 0 24px; border-radius: 8px; font: inherit; font-size: 16px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; align-self: flex-start;
}
.btn:focus-visible, .link:focus-visible, .link-back:focus-visible, input:focus-visible { outline: 3px solid #8fa8ef; outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: #ffffff; }
.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn-secondary:hover:not(:disabled) { background: var(--subtle); }
.btn-danger { background: var(--danger); color: #ffffff; min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; flex-shrink: 0; }
.link, .link-back {
  background: none; border: none; padding: 0; font: inherit; font-size: 14px; color: var(--accent);
  cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
}
.link:hover, .link-back:hover { color: var(--accent-hover); text-decoration: underline; }
.link-back { align-self: flex-start; min-height: 32px; }
.actions { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.actions-end { justify-content: flex-end; }

/* List (screens 2 and 11) */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.list-head .lead { font-size: 15px; }
.list-head .btn { min-height: 44px; padding: 0 20px; font-size: 15px; }
.methods { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.methods li { display: flex; align-items: center; gap: 16px; padding: 20px 24px; }
.methods li + li { border-top: 1px solid #eceef2; }
.item-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.item-text { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item-name { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.item-detail { font-size: 14px; line-height: 1.45; color: var(--muted); }
.empty { padding: 32px 24px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--lead); }

/* Add (screen 3) */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; gap: 16px; }
.step-no {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-title { font-size: 15px; font-weight: 500; }
.step-text { font-size: 14px; line-height: 1.5; color: var(--muted); }
.step-text strong { color: var(--text-2); }
label { font-size: 14px; font-weight: 500; }
input[type='text'] {
  height: 44px; padding: 0 14px; border: 1px solid var(--input-border); border-radius: 8px;
  font: inherit; font-size: 15px; color: var(--text); background: var(--surface); width: 100%;
}
input[readonly] { background: var(--subtle); color: var(--text-2); font-size: 14px; }
input[aria-invalid='true'] { border-color: var(--danger); }
.field-error { font-size: 13px; color: var(--danger); }
.copy { display: flex; gap: 8px; }
.copy input { flex-grow: 1; min-width: 0; }
.copy .btn { flex-shrink: 0; white-space: nowrap; align-self: auto; }
.reasons { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.plain-steps { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.6; color: var(--text-2); }

/* Remove (screen 6) */
.dialog { width: min(480px, calc(100vw - 32px)); border: none; border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.dialog:not([open]) { display: none; }
.dialog::backdrop { background: rgba(22, 24, 29, 0.38); }

/* Loading */
.loading { display: flex; align-items: center; gap: 12px; color: var(--lead); padding: 48px 0; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Phone width (screens 11 and 12) */
@media (max-width: 600px) {
  .top { padding: 8px 16px; min-height: 56px; }
  .logo { width: 72px; height: 24px; }
  .user { width: 100%; justify-content: space-between; gap: 12px; }
  main { padding: 24px 16px; }
  .card, .card-wide { padding: 24px 20px; gap: 20px; }
  h1 { font-size: 24px; }
  .methods li { display: grid; grid-template-columns: 44px 1fr; align-items: start; padding: 16px; gap: 12px; }
  .methods li .btn { grid-column: 2; justify-self: start; min-height: 44px; }
  .btn { width: 100%; }
  .btn-small, .copy .btn, .link-back { width: auto; }
  .copy { flex-direction: column; }
  .copy .btn { width: 100%; }
}
