:root {
  color-scheme: dark;
  --portal-bg: #1d1d1f;
  --portal-surface: #202022;
  --portal-text: #efeff1;
  --portal-muted: #a7a7ad;
  --portal-border: #3d3d42;
  --portal-input: #2a2a2d;
  --portal-accent: #3f5bc7;
  --portal-accent-hover: #4a66d3;
  --portal-danger: #ff6b66;
  --portal-success: #57d7a0;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--portal-text);
  background: var(--portal-bg);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.portal-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 66px 0 80px;
}

.portal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--portal-border);
  color: var(--portal-text);
  text-decoration: none;
}

.portal-logo-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 3px;
  color: #111;
  background: white;
  font-size: 28px;
  font-weight: 900;
}

.portal-brand {
  font-size: 30px;
  font-weight: 750;
}

.portal-brand-divider {
  color: var(--portal-muted);
  font-size: 30px;
  font-weight: 300;
}

.portal-brand-product {
  font-size: 29px;
  font-weight: 600;
}

.portal-content {
  width: min(730px, 100%);
  margin: 44px auto 0;
}

.portal-heading {
  text-align: center;
}

.portal-heading h1 {
  margin: 0;
  font-size: 32px;
}

.portal-heading p {
  max-width: 680px;
  margin: 16px auto 0;
  color: var(--portal-muted);
  font-size: 22px;
  line-height: 1.55;
}

.portal-form {
  margin-top: 42px;
}

.portal-field {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.portal-field > label {
  font-size: 20px;
  font-weight: 650;
}

.portal-required {
  color: var(--portal-danger);
}

.portal-input-wrap {
  position: relative;
}

.portal-input-wrap input,
.portal-field > input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  outline: none;
  color: var(--portal-text);
  background: var(--portal-input);
  font-size: 20px;
}

.portal-input-wrap input::placeholder,
.portal-field > input::placeholder {
  color: #77777d;
}

.portal-input-wrap input:focus,
.portal-field > input:focus {
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(63, 91, 199, 0.2);
}

.portal-password-toggle {
  position: absolute;
  top: 50%;
  right: 16px;
  border: 0;
  color: var(--portal-text);
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.portal-submit {
  width: 100%;
  min-height: 58px;
  margin-top: 30px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--portal-accent);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.portal-submit:hover {
  background: var(--portal-accent-hover);
}

.portal-submit:disabled {
  opacity: 0.68;
  cursor: wait;
}

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

.portal-alternate a {
  color: #7187eb;
  text-decoration: none;
}

.portal-form-status {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 102, 0.35);
  border-radius: 6px;
  color: var(--portal-danger);
  background: rgba(255, 107, 102, 0.08);
  font-size: 14px;
}

.portal-form-status[data-type="success"] {
  border-color: rgba(87, 215, 160, 0.35);
  color: var(--portal-success);
  background: rgba(87, 215, 160, 0.08);
}

.portal-dashboard {
  display: grid;
  gap: 22px;
}

.portal-dashboard-card {
  padding: 26px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: var(--portal-surface);
}

.portal-dashboard-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.portal-dashboard-card p,
.portal-dashboard-card dd {
  color: var(--portal-muted);
}

.portal-dashboard-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 0;
}

.portal-dashboard-card dt {
  margin-bottom: 5px;
  color: var(--portal-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.portal-dashboard-card dd {
  margin: 0;
  color: var(--portal-text);
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.portal-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  color: var(--portal-text);
  background: var(--portal-input);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.portal-action--primary {
  border-color: var(--portal-accent);
  color: white;
  background: var(--portal-accent);
}

@media (max-width: 640px) {
  .portal-shell {
    padding-top: 38px;
  }

  .portal-brand,
  .portal-brand-divider,
  .portal-brand-product {
    font-size: 21px;
  }

  .portal-logo-mark {
    width: 44px;
    height: 44px;
  }

  .portal-heading p {
    font-size: 17px;
  }

  .portal-dashboard-card dl {
    grid-template-columns: 1fr;
  }
}
