:root {
  --bg: #98d5fb;
  --pattern: rgba(38, 129, 190, 0.22);
  --card: rgba(255, 255, 255, 0.86);
  --card-solid: #ffffff;
  --text: #111827;
  --muted: #7b8794;
  --field: #eef3f6;
  --blue: #79b8f3;
  --blue-strong: #2196df;
  --line: #dce7ef;
  --warning: #fff4d8;
  --warning-line: #edc96b;
  --danger: #d93f3f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20px 20px, transparent 0 14px, var(--pattern) 15px 16px, transparent 17px),
    radial-gradient(circle at 68px 60px, transparent 0 18px, var(--pattern) 19px 20px, transparent 21px),
    linear-gradient(135deg, #86ccfb, #d9f7f0);
  background-size: 96px 96px, 120px 120px, auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 18px;
}

.login-card {
  width: min(460px, 100%);
  min-height: 560px;
  padding: 74px 54px 38px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(36, 77, 105, 0.22);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 58px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px 14px 14px 14px;
  background:
    radial-gradient(circle at 36% 38%, #ffffff 0 25%, transparent 26%),
    conic-gradient(from 230deg, #5ee2ff, #2e8df0, #6d38db, #2e8df0, #5ee2ff);
}

.form,
.success {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.copy {
  text-align: center;
}

h1 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  margin: 0;
}

.copy p,
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.compact-hint {
  text-align: center;
  font-size: 12px;
}

.phone-field {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--field);
}

.twofa {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.twofa input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.phone-field:focus-within {
  border-color: var(--blue-strong);
  box-shadow: 0 0 0 4px rgba(33, 150, 223, 0.14);
}

.flag,
.country {
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.warning {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--warning-line);
  border-radius: 10px;
  background: var(--warning);
  font-size: 12px;
  line-height: 1.35;
}

.warning strong {
  font-size: 13px;
}

.warning.compact {
  margin-top: 4px;
}

.consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.consent input {
  min-height: 18px;
  margin: 0;
  accent-color: var(--blue-strong);
}

.primary,
.secondary,
.back {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
}

.primary {
  color: white;
  background: var(--blue);
}

.primary:hover {
  background: var(--blue-strong);
}

.secondary,
.back {
  color: var(--blue-strong);
  background: transparent;
}

.back {
  align-self: flex-start;
  min-height: 32px;
  padding: 0;
}

.links {
  display: grid;
  gap: 18px;
  margin-top: 4px;
  justify-items: center;
}

.links button {
  border: 0;
  color: #258cca;
  background: transparent;
  font-weight: 800;
}

.code-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 8px 0;
}

.code-input {
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  text-align: center;
  font-size: 28px;
  font-weight: 900;
}

.error {
  min-height: 17px;
  color: var(--danger);
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
}

.success {
  align-items: center;
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #25b76b;
  font-size: 34px;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 28px));
  padding: 12px 14px;
  border-radius: 12px;
  color: white;
  background: #17212b;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none !important;
}

.admin-card {
  min-height: 0;
}

.admin-brand {
  margin-bottom: 34px;
}

.admin-current {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  word-break: break-all;
}

.admin-current span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.domain-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.domain-form input {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.domain-form .primary {
  padding: 0 16px;
}

.domain-list {
  display: grid;
  gap: 8px;
}

.domain-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  word-break: break-all;
}

.domain-row button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: #1788cf;
  background: #e6f3ff;
  font-weight: 800;
}

.domain-row button:disabled {
  color: #7b8794;
  background: #eef3f6;
  cursor: default;
}

@media (max-width: 520px) {
  .page {
    padding: 16px;
  }

  .login-card {
    min-height: auto;
    padding: 48px 24px 28px;
  }

  .brand {
    margin-bottom: 42px;
  }

  .domain-form,
  .domain-row {
    grid-template-columns: 1fr;
  }
}
