:root {
  color-scheme: only light;
  --ink: #111411;
  --muted: #66706a;
  --surface: #ffffff;
  --canvas: #f3f5f3;
  --line: #dce2de;
  --mint: #62dba7;
  --violet: #6548db;
  --danger: #b42318;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.portal-shell {
  width: min(100%, 470px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(25, 37, 29, .08);
}

.portal-shell::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--violet) 0 33%, var(--mint) 33% 100%);
}

.portal-header {
  padding: 36px 44px 28px;
  border-bottom: 1px solid #edf0ee;
}

.brand-logo {
  display: block;
  width: 220px;
  max-width: 74%;
  height: auto;
}

.access-panel { padding: 36px 44px 28px; }

.view { display: none; opacity: 0; transform: translateY(4px); }
.view.is-visible { display: block; animation: reveal .24s ease-out forwards; }

@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.lede {
  margin: 12px 0 30px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.field > label,
#otp-form > label {
  display: block;
  margin-bottom: 8px;
  color: #343a36;
  font-size: 13px;
  font-weight: 600;
}

.name-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.field--email { margin-bottom: 0; }

.input-wrap { position: relative; }

.field input, .otp-input {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 16px;
  outline: none;
  border: 1px solid #cbd3cd;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
}

.field > input { padding-right: 16px; }

input::placeholder { color: #929a95; }
input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(101, 72, 219, .1); }

.input-arrow {
  position: absolute;
  top: 50%;
  right: 17px;
  color: var(--violet);
  transform: translateY(-50%);
}

.consent {
  display: grid;
  grid-template-columns: 17px 1fr;
  gap: 10px;
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.consent input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--violet); }

.primary-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 0 18px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .15s;
}

.primary-button:hover { background: #272c28; }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .55; }

.button-glyph {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--ink);
  background: var(--mint);
  font-size: 17px;
}

.primary-button--link { margin-top: 26px; }

.text-button, .resend-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.text-button { margin-bottom: 28px; }
.resend-button { margin-top: 16px; }
.resend-button:not(:disabled) { color: var(--violet); }

.otp-input {
  height: 64px;
  padding: 0 16px;
  text-align: center;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: .28em;
}

#otp-form .primary-button { margin-top: 16px; }

.success-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  color: #115c3d;
  background: #dff8ea;
}

.success-mark span { font-size: 20px; }

.status-message {
  min-height: 18px;
  margin-top: 13px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.status-message.is-success { color: #16734d; }

footer {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #edf0ee;
  color: #8b938e;
  font-size: 11px;
}

@media (max-width: 520px) {
  body { display: block; padding: 0; background: #fff; }
  .portal-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .portal-header { padding: 32px 26px 25px; }
  .brand-logo { width: 200px; max-width: 72%; }
  .access-panel { padding: 31px 26px 24px; }
  h1 { font-size: 30px; }
  footer { margin-top: 36px; }
}

@media (max-width: 370px) {
  .name-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
