:root {
  color-scheme: light;
  --bg: #fffaf0;
  --panel: #ffffff;
  --text: #17131f;
  --muted: #665f72;
  --line: #201a2a;
  --accent: #174bff;
  --accent-strong: #102fb1;
  --danger: #e2213f;
  --warning: #876100;
  --success: #12966e;
  --fou-yellow: #ffe04b;
  --fou-pink: #ff4fa3;
  --fou-cyan: #1ec8d8;
  --fou-lime: #b4ff63;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 224, 75, .58) 0 72px, transparent 74px),
    radial-gradient(circle at 88% 6%, rgba(255, 79, 163, .2) 0 110px, transparent 112px),
    linear-gradient(90deg, rgba(23, 75, 255, .08) 1px, transparent 1px),
    linear-gradient(rgba(226, 33, 63, .055) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

body::before {
  content: "SAFE AUTH  ВХОД  SSO  ГОТОВО";
  position: fixed;
  right: -90px;
  bottom: 14px;
  z-index: -1;
  color: rgba(23, 19, 31, .06);
  font-size: clamp(42px, 8vw, 96px);
  font-weight: 950;
  transform: rotate(-7deg);
  white-space: nowrap;
}

a {
  color: var(--accent-strong);
}

.ui-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 14px clamp(16px, 5vw, 56px);
  background: linear-gradient(135deg, #17131f 0 60%, #242039 60%);
  border-bottom: 5px solid var(--fou-yellow);
  box-shadow: 0 6px 0 var(--fou-pink);
}

.ui-brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-weight: 950;
  text-decoration: none;
}

.ui-brand::before {
  content: "";
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border: 3px solid var(--fou-yellow);
  border-radius: 50% 50% 50% 8px;
  background:
    radial-gradient(circle at 50% 42%, var(--fou-pink) 0 5px, transparent 6px),
    linear-gradient(90deg, transparent 48%, var(--fou-yellow) 48% 56%, transparent 56%),
    var(--accent);
  box-shadow: 3px 3px 0 var(--fou-pink);
  transform: rotate(-8deg);
}

.ui-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.ui-nav a,
.auth-links a {
  color: #fff;
  text-decoration: none;
}

.ui-nav a:hover,
.auth-links a:hover {
  color: var(--accent-strong);
}

.ui-shell,
.ui-auth-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 32px auto;
}

.ui-auth-shell {
  display: grid;
  min-height: calc(100vh - 128px);
  place-items: center;
}

.ui-section {
  display: grid;
  gap: 20px;
}

.ui-section.narrow {
  max-width: 760px;
}

.ui-panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 6px 6px 0 rgba(23, 19, 31, .14);
}
.protection-summary {
  border-color: #17131f;
  box-shadow: 5px 5px 0 var(--fou-yellow), 9px 9px 0 var(--fou-pink);
}
.protection-stamp {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 5px 9px;
  border: 2px solid currentColor;
  font-weight: 800;
  text-transform: uppercase;
  transform: rotate(-2deg);
}
.protection-stamp.good {
  color: var(--success);
}
.protection-stamp.warn {
  color: var(--warning);
}

.auth-panel {
  width: min(480px, 100%);
  position: relative;
  overflow: hidden;
}

.auth-panel::after {
  content: "пропуск";
  position: absolute;
  right: 16px;
  top: 16px;
  padding: 3px 8px;
  border: 2px solid var(--danger);
  background: #fff;
  color: var(--danger);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  transform: rotate(4deg);
}

h1,
h2 {
  margin: 0 0 14px;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.ui-form,
.compact-form {
  display: grid;
  gap: 14px;
}

.compact-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}
label .ui-hint {
  font-size: 13px;
}

input,
select,
button {
  min-height: 42px;
  border-radius: 8px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 2px solid #d9d3c6;
  padding: 9px 11px;
  color: var(--text);
  background: #fffefb;
}

input:focus,
select:focus {
  outline: 3px solid rgba(255, 224, 75, .85);
  border-color: var(--accent);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--text);
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 850;
  box-shadow: 3px 3px 0 var(--text);
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--accent-strong);
}

button:hover,
.button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--text);
}

button.danger,
.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-row input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.auth-links,
.provider-list,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.auth-method-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}
.auth-method-strip span {
  display: inline-flex;
  padding: 4px 9px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--fou-yellow);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.auth-method-strip span:nth-child(2n) { background: #eafbff; }
.auth-method-strip span:nth-child(3n) { background: #fff1f8; }

.ui-passport {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #fffdf6;
}

.ui-passport b {
  color: var(--accent);
  text-transform: uppercase;
}

.ui-auth-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
  padding: 0;
  list-style: none;
}

.ui-auth-steps li {
  min-height: 78px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ui-auth-steps span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 6px;
  border-radius: 50%;
  border: 2px solid var(--text);
  background: var(--fou-lime);
  font-weight: 950;
}

.mfa-grid,
.ui-grid {
  display: grid;
  gap: 16px;
}

.ui-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ui-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-panel {
  color: inherit;
  text-decoration: none;
}

.ui-error,
.ui-warning,
.ui-success {
  margin: 0 0 14px;
  border-radius: 8px;
  padding: 12px 14px;
}

.ui-error {
  border: 1px solid #f0b7bd;
  background: #fff1f2;
  color: var(--danger);
}

.ui-warning {
  border: 1px solid #eed58c;
  background: #fff8db;
  color: var(--warning);
}

.ui-success {
  border: 1px solid #b9e2cc;
  background: #eefaf3;
  color: var(--success);
}

.ui-muted,
.ui-hint {
  color: var(--muted);
}

.details {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 10px 16px;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
}

.ui-table th,
.ui-table td {
  padding: 10px;
  border-bottom: 2px solid #eee7d8;
  text-align: left;
  vertical-align: top;
}

.inline-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.inline-form input {
  width: min(220px, 100%);
}

.secret-panel pre,
.secret-value {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

@media (max-width: 780px) {
  .ui-shell-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ui-grid.two,
  .ui-grid.three,
  .ui-auth-steps {
    grid-template-columns: 1fr;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .ui-panel {
    padding: 18px;
  }
}
