*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg:            #f0f0f2;
  --surface:       #ffffff;
  --text:          #1a1a1a;
  --muted:         #6b6b6b;
  --border:        rgba(0,0,0,0.08);
  --shadow:        0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --link:          #0070f3;
  --link-hover:    #0051bb;
  --radius:        10px;
}

[data-theme="dark"] {
  --bg:            #111113;
  --surface:       #1c1c1f;
  --text:          #ececec;
  --muted:         #8f8f9d;
  --border:        rgba(255,255,255,0.08);
  --shadow:        0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.4);
  --link:          #60a5fa;
  --link-hover:    #93c5fd;
}

html { color-scheme: light dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--border);
}

/* ── layout ─────────────────────────────────────────────── */

.layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ── logo ────────────────────────────────────────────────── */

img.logo { display: block; width: 220px; height: auto; margin-bottom: 1.25rem; }
img.logo-dark { display: none; }
[data-theme="dark"] img.logo-light { display: none; }
[data-theme="dark"] img.logo-dark  { display: block; }

/* ── page content ────────────────────────────────────────── */

.description { color: var(--muted); margin: 0 0 1.25rem; }

.links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.links li { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); }

.title { margin: 0 0 0.5rem; font-size: 18px; font-weight: 600; }
.title.granted { color: #16a34a; }
.title.denied  { color: #dc2626; }
[data-theme="dark"] .title.granted { color: #4ade80; }
[data-theme="dark"] .title.denied  { color: #f87171; }

.close { margin-top: 1.25rem; font-size: 13px; color: var(--muted); }

/* ── theme toggle ────────────────────────────────────────── */

#theme-btn {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 100;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease,
              color 0.2s ease, transform 0.15s ease;
}
#theme-btn:hover { color: var(--text); transform: scale(1.08); }

/* The button contains one <svg> with three <use> children.
   Only the one matching the current mode is shown. */
#theme-btn svg { width: 18px; height: 18px; display: block; }

#theme-btn .icon-sun,
#theme-btn .icon-moon,
#theme-btn .icon-system { display: none; }

[data-theme-mode="light"]  #theme-btn .icon-sun    { display: block; }
[data-theme-mode="dark"]   #theme-btn .icon-moon   { display: block; }
[data-theme-mode="system"] #theme-btn .icon-system { display: block; }
