/* Colours and radius come from css/tokens.css, loaded before this file. */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
}

.auth {
  display: grid;
  grid-template-columns: minmax(360px, 41%) 1fr;
  min-height: 100vh;
}

/* ---------- Form side ---------- */

.auth__form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px;
}

.auth__form-wrap {
  width: 100%;
  max-width: 340px;
  margin: auto 0;
}

.auth__footer {
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}

.logo img { display: block; max-width: 100%; height: auto; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 128, 128, 0.2);
}

.field input[aria-invalid="true"] { border-color: var(--danger); }

.field__control { position: relative; }

.field__control input { padding-right: 64px; }

.field__toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: none;
  border: 0;
  cursor: pointer;
}

.field__error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--danger);
}

.alert {
  margin-bottom: 18px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: var(--radius);
}

/* Information, not an error: e.g. signed out after inactivity. */
.alert--info { color: var(--ink); background: var(--brand-tint); }

.btn {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: 0.7; cursor: wait; }

.btn:focus-visible,
.field__toggle:focus-visible,
.link:focus-visible,
.dot:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 13px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.link {
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.link:hover { text-decoration: underline; }

/* ---------- Promo side ---------- */

.promo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px 32px;
  color: #fff;
  background: var(--brand);
}

.promo .dot:focus-visible { outline-color: #fff; }

.shape { position: absolute; display: block; }

.shape--circle-a {
  top: -90px; left: -40px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: var(--brand-dark);
}

.shape--circle-b {
  right: 40px; bottom: 28%;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--brand-dark);
}

.shape--ring {
  top: -240px; right: -240px;
  width: 620px; height: 620px;
  border-radius: 50%;
  border: 90px solid var(--brand-deep);
  opacity: 0.75;
}

.shape--square {
  right: -30px; bottom: 30%;
  width: 90px; height: 90px;
  background: var(--brand-deep);
}

.shape--tri-a {
  top: 0; left: 30%;
  border-left: 110px solid transparent;
  border-top: 110px solid var(--brand-light);
  opacity: 0.6;
}

.shape--tri-b {
  bottom: 0; left: 0;
  border-right: 420px solid transparent;
  border-bottom: 420px solid var(--brand-dark);
  opacity: 0.55;
}

.promo__inner {
  position: relative;
  top: 20px; /* laptop sits 20px below the panel's vertical centre */
  width: 100%;
  max-width: 520px;
  text-align: center;
}

/* Laptop sits at the exact vertical centre of the panel; the caption hangs
   below it, out of flow, so it does not shift the laptop upward. */
.laptop { margin: 0 auto; max-width: 440px; }

.promo__caption {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 48px;
}

/* Short windows: caption would be clipped, so stack normally instead. */
@media (max-height: 760px) {
  .promo__caption { position: static; }
}

.laptop__screen {
  padding: 10px 10px 12px;
  background: #fff;
  border: 1px solid #dfe3ee;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 24px 48px rgba(8, 50, 50, 0.3);
}

.laptop__base {
  height: 9px;
  margin: 0 -9%;
  background: linear-gradient(#f4f5f9, #cfd4e2);
  border-radius: 0 0 14px 14px;
}

.mock {
  display: grid;
  grid-template-columns: 44px 30% 1fr;
  gap: 8px;
  aspect-ratio: 16 / 10;
  padding: 8px;
  background: #f6f7fb;
  border-radius: 4px;
  text-align: left;
}

.mock span, .mock b, .mock i, .mock em, .mock p {
  display: block;
  margin: 0;
  border-radius: 3px;
  background: #dfe3ee;
}

.mock__side { display: flex; flex-direction: column; gap: 9px; padding: 6px 2px 0; }
.mock__side span { height: 5px; }
.mock__side .mock__logo { height: 12px; margin-bottom: 6px; background: var(--ink); }
.mock__side .is-active { background: var(--brand); }

.mock__list { display: flex; flex-direction: column; gap: 6px; }

.mock__item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 4px 6px;
  flex: 1;
  align-content: center;
  padding: 6px;
  background: #fff;
  border-radius: 4px;
}

.mock__item.is-active { box-shadow: inset 2px 0 0 var(--brand); }
.mock__item i { grid-row: span 2; width: 14px; height: 14px; border-radius: 50%; }
.mock__item b { height: 5px; width: 60%; background: #b9c0d4; }
.mock__item em { height: 4px; }

.mock__main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  padding: 10px;
  background: #fff;
  border-radius: 4px;
}

.mock__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mock__head b { width: 45%; height: 6px; background: #b9c0d4; }
.mock__head span { width: 22%; height: 10px; background: var(--brand); }
.mock__main p { height: 4px; }
.mock__main p.short { width: 55%; }
.mock__tiles { display: flex; gap: 6px; margin: 4px 0; }
.mock__tiles span { width: 26px; height: 26px; background: #c9cfdf; }
.mock__tiles span:first-child { background: var(--brand-light); }

.slides { display: grid; min-height: 104px; }

.slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s;
}

.slide.is-active { opacity: 1; visibility: visible; }

.slide h2 { margin: 0 0 10px; font-size: 19px; font-weight: 600; }

.slide p {
  max-width: 400px;
  margin: 0 auto;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}

.dots { display: flex; justify-content: center; gap: 4px; margin-top: 28px; }

.dot {
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.dot::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.2s, transform 0.2s;
}

.dot.is-active::before { background: #fff; transform: scale(1.25); }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .promo { display: none; }
}

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

/* ---------- Locked account popup ---------- */

.lock-dialog {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 28px 26px 24px;
  text-align: center;
  color: var(--ink);
  background: var(--surface, #fff);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.lock-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }

.lock-dialog h2 { margin: 12px 0 8px; font-size: 20px; }
.lock-dialog p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.lock-dialog p[hidden], .lock-dialog__actions[hidden] { display: none; }
.lock-dialog__sent { color: var(--ink) !important; }

.lock-dialog__icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 50%;
}

.lock-dialog__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lock-dialog__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.lock-dialog__close:hover { color: var(--ink); background: var(--page-bg); }

.lock-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.lock-dialog__actions .btn { margin: 0; text-decoration: none; text-align: center; }

.btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
  background: transparent;
  border: 1px solid var(--line);
}

.btn--ghost:hover { color: var(--brand-dark); background: var(--brand-tint); }
