:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #101828;
  --muted: #667085;
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --border: #e5e7eb;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  --danger: #b42318;
  --success: #067647;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.08), transparent 24%),
    radial-gradient(circle at bottom right, rgba(11, 132, 147, 0.10), transparent 24%),
    var(--bg);
}

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

.auth-shell,
.home-shell {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  padding: 56px 16px 32px;
}

.auth-card,
.home-card {
  width: min(540px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-hero {
  width: min(540px, 100%);
  display: flex;
  justify-content: center;
}

.auth-brand,
.home-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.auth-logo,
.home-logo {
  width: 84px;
  height: auto;
  display: block;
}

.auth-logo--hero {
  width: auto;
  max-width: none;
}

.auth-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-card h1,
.home-card h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.auth-card-head {
  margin-bottom: 18px;
}

.auth-copy {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-alert {
  border: 1px solid rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 600;
}

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

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

.field input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}

.field input:focus,
.ghost-button:focus,
.submit-button:focus,
.submit-button.secondary:focus {
  outline: 3px solid rgba(124, 58, 237, 0.22);
  outline-offset: 2px;
}

.password-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.password-row input {
  flex: 1;
}

.ghost-button,
.submit-button {
  border: 0;
  border-radius: 12px;
  min-height: 50px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button {
  padding: 0 14px;
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 0 20px;
}

.submit-button.secondary {
  background: #111827;
  display: inline-flex;
  width: fit-content;
}

.submit-button:disabled,
.ghost-button:disabled {
  opacity: 0.68;
  cursor: progress;
}

.caps-lock,
.loading {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.caps-lock {
  color: #b54708;
}

.loading {
  color: var(--success);
  font-weight: 600;
}

.home-card {
  width: min(760px, 100%);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.info-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fafafa;
}

.info-box span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.info-box strong {
  font-size: 1.02rem;
}

.info-box.full {
  grid-column: 1 / -1;
}

.home-actions {
  display: flex;
  justify-content: flex-end;
}

.portal-footer {
  height: 64px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--muted);
  border-top: 1px solid rgba(229, 231, 235, 0.8);
  gap: 16px;
}

.portal-footer-left {
  justify-self: start;
  white-space: nowrap;
}

.portal-footer-center {
  justify-self: center;
  text-align: center;
}

.portal-footer-right {
  justify-self: end;
}

@media (max-width: 640px) {
  .auth-card,
  .home-card {
    padding: 22px;
  }

  .auth-shell,
  .home-shell {
    gap: 18px;
    padding-top: 34px;
  }

  .auth-hero {
    width: min(100%, 540px);
  }

  .auth-logo--hero {
    width: auto;
  }

  .auth-brand,
  .home-header {
    align-items: flex-start;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .password-row {
    flex-direction: column;
  }

  .submit-button.secondary {
    width: 100%;
  }

  .portal-footer {
    grid-template-columns: 1fr;
    height: auto;
    padding: 16px 18px;
    text-align: center;
  }

  .portal-footer-left,
  .portal-footer-center,
  .portal-footer-right {
    justify-self: center;
    white-space: normal;
  }
}
