:root {
  --teal: #0097bd;
  --teal-press: #0087a9;
  --teal-footer: #00a0cd;
  --ink: #212121;
  --ink-soft: #4f4f4f;
  --label: #6f6f6f;
  --placeholder: #8a8a8a;
  --border: #7b7b7b;
  --card: #ffffff;
  --danger: #c8102e;
  --card-pad-x: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--teal);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; touch-action: manipulation; }

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

/* ---------- brand ---------- */
.brand {
  display: flex;
  justify-content: center;
  padding: 4px 0 30px;
}

.logo {
  width: 124px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- stack ---------- */
.stack {
  margin: 0 clamp(16px, 9.2vw, 36px);
  display: flex;
  flex-direction: column;
}

/* ---------- restricted bar ---------- */
.restricted {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--danger);
  color: #fff;
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(120, 10, 20, 0.22);
  animation: drop 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.restricted[hidden] { display: none; }

.restricted__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
}

.restricted__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.35;
}

.restricted__text strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.restricted__text span { color: rgba(255, 255, 255, 0.92); }

@keyframes drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- card ---------- */
.card {
  background: var(--card);
  border-radius: 26px;
  padding: 28px var(--card-pad-x) 22px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.card__title {
  margin: 0;
  text-align: center;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.card__sub {
  margin: 7px 0 0;
  text-align: center;
  font-size: 15.5px;
  line-height: 1.3;
  font-weight: 400;
  color: var(--ink-soft);
}

/* ---------- fields ---------- */
.field {
  position: relative;
  height: 58px;
  margin-top: 22px;
  border: 1.5px solid #c2c2c2;
  border-radius: 16px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field + .field { margin-top: 18px; }

.field.filled { border-color: #7b7b7b; }

.field.focus {
  border-color: #1f1f1f;
  box-shadow: inset 0 0 0 0.6px #1f1f1f;
}

.field input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 21px 46px 7px 17px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
  outline: none;
}

.field input:disabled { color: #4a4a4a; -webkit-text-fill-color: #4a4a4a; opacity: 1; }

.field label {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--placeholder);
  pointer-events: none;
  transition: top 0.14s ease, font-size 0.14s ease, transform 0.14s ease;
}

.field.filled label,
.field.focus label {
  top: 10px;
  transform: none;
  font-size: 12px;
  font-weight: 400;
  color: var(--label);
}

.field__clear,
.field__reveal {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b6b6b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.field__clear[hidden] { display: none; }

.field__clear svg { width: 18px; height: 18px; }
.field__reveal svg { width: 21px; height: 21px; }

.field.invalid { border-color: var(--danger); }

/* ---------- links & buttons ---------- */
.forgot {
  display: inline-block;
  align-self: flex-start;
  margin: 16px 0 6px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}

.forgot:active { opacity: 0.7; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn--primary {
  margin-top: 26px;
  height: 58px;
  background: var(--teal);
  color: #fff;
}

.btn--primary:active:not(:disabled) { background: var(--teal-press); }

.btn--secondary {
  margin-top: 16px;
  height: 58px;
  background: #fff;
  border: 1.3px solid var(--teal);
  color: var(--teal);
  font-weight: 600;
}

.btn--secondary:active:not(:disabled) { background: #f2fafc; }

.btn:disabled { cursor: default; }

.btn--secondary:disabled {
  border-color: #d7e6ea;
  color: #b9ced4;
  background: #fff;
}

.btn--primary:disabled { background: #8bc2d0; }

/* loading dots */
.btn__dots {
  display: none;
  align-items: center;
  gap: 7px;
}

.btn__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.45;
  animation: pulse 1.05s infinite ease-in-out;
}

.btn__dots i:nth-child(2) { animation-delay: 0.16s; }
.btn__dots i:nth-child(3) { animation-delay: 0.32s; }

.btn.loading .btn__label { display: none; }
.btn.loading .btn__dots { display: flex; }

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* locked state */
.card.locked .field { background: #f7f7f7; border-color: #dcdcdc; }
.card.locked .field.focus { border-color: #dcdcdc; box-shadow: none; }
.card.locked .field label { color: #9a9a9a; }
.card.locked .forgot { color: #9db9c0; pointer-events: none; }

/* ---------- footer ---------- */
.footer {
  margin-top: auto;
  background: var(--teal-footer);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 12px;
}

.footer a {
  color: #fff;
  text-decoration: none;
  opacity: 0.96;
}

.footer .dot { color: rgba(255, 255, 255, 0.85); font-size: 11px; }

@media (min-width: 560px) {
  .stack { max-width: 400px; margin: 0 auto; width: 100%; }
  .brand { padding-bottom: 24px; }
}
