:root {
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.64);
  --glass: rgba(24, 27, 33, 0.58);
  --glass-line: rgba(255, 255, 255, 0.14);
  --fill: rgba(255, 255, 255, 0.08);
  --fill-hover: rgba(255, 255, 255, 0.13);
  --fill-line: rgba(255, 255, 255, 0.12);
  --danger: #ff8a80;
  --ok: #8ee6b0;
  --radius-card: 32px;
  --radius: 16px;
  --control: 56px;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  background-color: #2a3036;
  background-image:
    linear-gradient(180deg, rgba(10, 12, 16, 0.18) 0%, rgba(10, 12, 16, 0.42) 100%),
    url("/static/bg.jpg");
  background-size: cover;
  background-position: center 58%;
  background-attachment: fixed;
}

@supports (-webkit-touch-callout: none) {
  /* iOS не умеет fixed-фон и растягивает его на всю страницу */
  body { background-attachment: scroll; }
}

.card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-card);
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 30px 80px -20px rgba(0, 0, 0, 0.55);
  animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stack {
  display: grid;
  gap: 12px;
}

.field {
  width: 100%;
  height: var(--control);
  padding: 0 18px;
  border: 1px solid var(--fill-line);
  border-radius: var(--radius);
  background: var(--fill);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  text-align: center;
  letter-spacing: 0.32em;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.field::placeholder {
  color: var(--text-soft);
  font-size: 17px;
  letter-spacing: normal;
}

.field:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: var(--fill-hover);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.field[aria-invalid="true"] {
  border-color: rgba(255, 138, 128, 0.7);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: var(--control);
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn:focus-visible,
.row:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.btn-primary {
  background: #ffffff;
  color: #15171c;
}

.btn-primary:hover { background: #ededf0; }

.actions {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.btn-glass {
  border: 1px solid var(--fill-line);
  background: var(--fill);
  color: var(--text);
}

.btn-glass:hover { background: var(--fill-hover); }

.btn-glass.done {
  border-color: rgba(142, 230, 176, 0.45);
  color: var(--ok);
}

.btn-icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.list {
  overflow: hidden;
  border: 1px solid var(--fill-line);
  border-radius: 20px;
  background: var(--fill);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--control);
  padding: 0 14px 0 20px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}

.row + .row {
  border-top: 1px solid var(--fill-line);
}

.row:hover { background: rgba(255, 255, 255, 0.06); }
.row:active { background: rgba(255, 255, 255, 0.1); }

.row-icon {
  width: 20px;
  height: 20px;
  color: var(--text-soft);
}

.note {
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: var(--danger);
}

.brand + .note {
  font-size: 17px;
}

@media (max-width: 380px) {
  .card { padding: 28px 20px 20px; border-radius: 28px; }
}
