:root {
  color-scheme: light;
  --bg: #071a33;
  --bg-soft: #0d2b52;
  --card: #ffffff;
  --ink: #102033;
  --muted: #607086;
  --line: #d9e2ee;
  --field: #f7f9fc;
  --primary: #0a4fb3;
  --primary-dark: #083f8e;
  --success: #0f7a4f;
  --success-bg: #e8f7ef;
  --error: #b42318;
  --error-bg: #fff0ed;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 34rem),
    linear-gradient(135deg, var(--bg) 0%, #08264a 48%, var(--bg-soft) 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.portal-card {
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.logo-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--primary), #0d7bd8);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-kicker,
.store-label,
.portal-header p,
.portal-footer {
  margin: 0;
}

.brand-kicker {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.store-label {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.portal-header {
  margin-bottom: 22px;
}

.portal-header h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(1.75rem, 9vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.portal-header p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

form {
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 7px;
}

label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #8c9aab;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(10, 79, 179, 0.14);
}

.terms-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
}

.terms-row input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.connect-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(10, 79, 179, 0.24);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.connect-button:hover {
  background: var(--primary-dark);
  box-shadow: 0 14px 28px rgba(10, 79, 179, 0.3);
  transform: translateY(-1px);
}

.connect-button:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.button-spinner {
  width: 18px;
  height: 18px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: spin 850ms linear infinite;
}

.connect-button.is-loading .button-spinner {
  display: inline-block;
}

.status-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}

.status-message.success {
  color: var(--success);
  background: var(--success-bg);
}

.status-message.error {
  color: var(--error);
  background: var(--error-bg);
}

.portal-footer {
  margin-top: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 640px) {
  .page-shell {
    padding: 44px 24px;
  }

  .portal-card {
    padding: 34px;
  }
}
