:root {
  --ink: #172033;
  --muted: #687386;
  --line: #d8e2ea;
  --surface: #ffffff;
  --soft: #f3f7fa;
  --blue: #1169a8;
  --red: #d71920;
  --green: #15803d;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #e9f0f5;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-body {
  min-height: 100vh;
  min-height: 100svh;
}

.auth-shell {
  display: grid;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  align-content: center;
  gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(243, 247, 250, 0.95)),
    var(--soft);
}

.auth-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(216, 226, 234, 0.95);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12);
}

.auth-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: #263145;
  font-size: 14px;
  font-weight: 950;
}

.auth-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 950;
}

.auth-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-heading {
  display: grid;
  gap: 4px;
}

.auth-heading p {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.auth-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #c9d6df;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  outline: 0;
}

.auth-form select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 16px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
    #f8fbfd;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(17, 105, 168, 0.16);
}

.auth-form .auth-check {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.auth-check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--blue);
}

.auth-check span {
  display: block;
}

.auth-primary {
  display: grid;
  min-height: 50px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 950;
}

.auth-primary:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.auth-status[hidden] {
  display: none;
}

.auth-status.error {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.auth-status.pending {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.auth-links a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.auth-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.auth-preview-item {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: #d8e2ea;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.auth-preview-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 760px) {
  body {
    padding: 24px 0;
  }

  .auth-shell {
    min-height: calc(100vh - 48px);
    border: 1px solid rgba(203, 213, 225, 0.7);
    border-radius: 22px;
  }
}

@media (max-width: 420px) {
  .auth-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
