/* Drasl у стилі beacon.how. Замінює штатний public/style.css Drasl 4.0.1
   (монтується в /usr/share/drasl/public/style.css). Селектори ті самі, що в
   оригіналі: шаблони Drasl не змінюються, лише вигляд. Функціональні правила
   (прев'ю скіна, аватарки, .noscript-hidden, .honeypot) перенесено без змін —
   без них ламаються сторінки акаунта й адмінки. */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700&display=swap");

:root {
  --bg: #f3f1ee;
  --surface: #ffffff;
  --fg: #17191c;
  --muted: #5f666d;
  --line: #e0dcd6;
  --accent: #c4613f;
  --accent-fg: #ffffff;
  --accent-soft: rgba(196, 97, 63, 0.12);
  --glow: rgba(217, 119, 87, 0.28);
  --ok: #2f8a4c;
  --warn: #a8650b;
  --err: #b8362b;
  --shadow: 0 1px 2px rgba(23, 25, 28, 0.05), 0 8px 24px -12px rgba(23, 25, 28, 0.18);
  --radius: 12px;
  --font-family: "Bricolage Grotesque", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f11;
    --surface: #15181b;
    --fg: #eceef0;
    --muted: #959ca4;
    --line: #252a31;
    --accent: #e08664;
    --accent-fg: #1a0f0a;
    --accent-soft: rgba(224, 134, 100, 0.14);
    --glow: rgba(217, 119, 87, 0.2);
    --ok: #6fcf8e;
    --warn: #f0b45a;
    --err: #f08a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

/* layout.tmpl ставить inline `html { background-color: black }` — цей файл
   підключається після нього, тож перемагає за порядком. */
html {
  background-color: var(--bg);
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--fg);
  background: radial-gradient(56rem 36rem at 62% -8rem, var(--glow), transparent 70%) no-repeat, var(--bg);
  line-height: 1.55;
  font-family: var(--font-family);
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-family);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h3 {
  font-size: 1.375rem;
  margin: 2rem 0 0.75rem;
}
h4 {
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.5rem;
}

p, li {
  text-wrap: pretty;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background-color: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  overflow-x: auto;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}
thead {
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
}
td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td:not(:last-child) {
  padding-right: 0.75rem;
}
td:last-child {
  text-align: right;
}

a,
a:visited {
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  font-weight: 600;
}
a:hover {
  color: var(--accent);
}

/* --- шапка --- */
.header-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  flex-wrap: wrap;
  padding: 0.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.header-nav > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem 0.75rem;
}
.header-nav a {
  text-decoration: none;
  color: var(--muted);
}
.header-nav a:hover {
  color: var(--fg);
}
.header-nav input[type="submit"] {
  margin: 0;
  min-height: 2.25rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
}

.logo,
.logo:visited {
  font-family: var(--font-family);
  color: var(--fg);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.logo > img {
  width: 1.5em;
  height: 1.5em;
}

.divider {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  gap: 0.75em;
  color: var(--muted);
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.openid-logo {
  height: 3rem;
  vertical-align: middle;
}

.honeypot {
  display: none;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

/* --- поля --- */
input,
select,
button {
  font-family: var(--font-family);
  font-size: 1rem;
}
input {
  color: var(--fg);
  accent-color: var(--accent);
}
input:disabled {
  color: var(--muted);
  filter: grayscale(100%);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
input[type="email"],
select {
  width: 20em;
  margin: 0.375em 0;
  background-color: var(--surface);
  color: var(--fg);
  padding: 0.625em 0.875em;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}
input.long {
  width: 34em;
}
@media (max-width: 600px) {
  input[type="text"]:not([hidden]),
  input[type="number"]:not([hidden]),
  input[type="password"]:not([hidden]),
  input.long:not([hidden]) {
    display: block;
    width: 100%;
  }
}
input[type="number"] {
  width: 6rem;
}
input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled),
select:not(:disabled) {
  cursor: pointer;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* --- кнопки --- */
button,
input[type="submit"],
input[type="file"]::file-selector-button {
  margin: 0.375em 0.25em 0.375em 0;
  display: inline-block;
  min-height: 2.75rem;
  padding: 0 1.25em;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 0.15s cubic-bezier(0.2, 0.7, 0.3, 1), filter 0.15s ease;
}
input[type="file"]::file-selector-button {
  margin-right: 0.75em;
}
button:not(:disabled):hover,
input[type="submit"]:not(:disabled):hover,
input[type="file"]:not(:disabled)::file-selector-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
button:not(:disabled):active,
input[type="submit"]:not(:disabled):active,
input[type="file"]:not(:disabled)::file-selector-button:active {
  transform: none;
  filter: brightness(0.95);
}
button:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:not(:disabled),
input[type="submit"]:not(:disabled),
input[type="file"]:not(:disabled)::file-selector-button {
  cursor: pointer;
}
button:disabled,
input[type="submit"]:disabled {
  opacity: 0.5;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}
legend {
  font-weight: 600;
  padding: 0 0.375rem;
}

/* --- службове з оригіналу (не чіпати) --- */
.svg-defs {
  width: 0;
  height: 0;
  position: absolute;
}
#background {
  z-index: -1;
  position: fixed;
  inset: 0;
  view-transition-name: background;
}
#content {
  max-width: 46rem;
  padding: 1.25rem 1rem 3rem;
  margin: auto;
}

.success-message,
.warning-message,
.error-message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid currentColor;
  background: var(--surface);
}
.success-message { color: var(--ok); }
.warning-message { color: var(--warn); }
.error-message { color: var(--err); }

#skin-container {
  text-align: center;
}
#skin-canvas {
  display: inline-block;
}
.texture-preview {
  width: 256px;
  image-rendering: pixelated;
}
.small-texture-preview {
  width: 64px;
  image-rendering: pixelated;
}
.noscript-hidden {
  display: none !important;
}

.list-profile-picture {
  --list-profile-picture-size: 24px;
  width: var(--list-profile-picture-size);
  height: var(--list-profile-picture-size);
  position: relative;
}
.list-profile-picture-back,
.list-profile-picture-body,
.list-profile-picture-front {
  width: 100%;
  height: 100%;
  position: absolute;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-image: var(--list-profile-picture-image);
  background-position-y: calc(-1 * var(--list-profile-picture-size));
  background-size: calc(8 * var(--list-profile-picture-size)),
    calc(8 * var(--list-profile-picture-size));
}
.list-profile-picture-back {
  background-position-x: calc(-7 * var(--list-profile-picture-size));
}
.list-profile-picture-body {
  transform: scale(0.92);
  background-position-x: calc(-1 * var(--list-profile-picture-size));
}
.list-profile-picture-front {
  background-position-x: calc(-5 * var(--list-profile-picture-size));
}

/* --- головна Beacon (root.tmpl) --- */
.beacon-hero {
  margin: 0.5rem 0 1.5rem;
}
.beacon-hero h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.035em;
}
.beacon-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 34rem;
}
.beacon-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}
.beacon-card h3 {
  margin-top: 0;
}
.beacon-steps {
  margin: 0;
  padding-left: 1.25rem;
}
.beacon-steps li + li {
  margin-top: 0.5rem;
}
.beacon-muted {
  color: var(--muted);
  font-size: 0.9375rem;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
