/* ResponseIQ agency portal sign-in, light theme (2026-11-11).
   Tokens are the live homepage's (styles-v2.css): white/soft-blue ground, navy ink, ResponseIQ cyan.
   The filled button uses the homepage's deep accent (#0077cc) because white on #00b7ff fails contrast. */
:root {
  --bg-base: #ffffff;
  --bg-ground: #f3f7fb;
  --text-primary: #0a1628;
  --text-secondary: #47546e;
  --text-muted: #5f6d84;
  --accent: #00b7ff;
  --accent-dk: #0077cc;
  --accent-deeper: #005fa3;
  --accent-tint: rgba(0, 183, 255, 0.10);
  --border-subtle: rgba(10, 22, 40, 0.10);
  --border-field: rgba(10, 22, 40, 0.22);
  --danger: #b42318;
  --danger-tint: #fef3f2;
  --danger-border: #f4b6b0;
  --success: #067647;
  --success-tint: #ecfdf3;
  --success-border: #a6e4c3;
  --warn: #8a4b00;
  --shadow-panel: 0 1px 2px rgba(10, 22, 40, 0.04), 0 12px 32px -8px rgba(10, 22, 40, 0.10);
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --radius-field: 12px;
  --radius-panel: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 50% -180px, rgba(0, 183, 255, 0.10), transparent 70%),
    var(--bg-ground);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(0, 119, 204, 0.18); color: var(--text-primary); }

a {
  color: var(--accent-dk);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-deeper); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(0, 119, 204, 0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Layout ─────────────────────────────────────────────── */
.signin {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: clamp(28px, 7vh, 72px) 20px 24px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.signin-brand {
  align-self: center;
  display: block;
  margin-bottom: clamp(20px, 4vh, 32px);
  border-radius: 8px;
}
.signin-brand img {
  display: block;
  width: 216px;
  height: auto;
}

.signin-panel {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 32px 32px 26px;
}

.signin-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.signin-lede {
  margin: 0 0 26px;
  color: var(--text-secondary);
  font-size: 0.975rem;
}

/* ── Form ───────────────────────────────────────────────── */
.login-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 7px; }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.forgot-link {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font: inherit;
  font-size: 1.0625rem; /* ≥16px: iOS Safari does not zoom on focus */
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-field);
  caret-color: var(--accent-dk);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]:hover,
input[type="password"]:hover { border-color: rgba(10, 22, 40, 0.34); }
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-dk);
  box-shadow: 0 0 0 4px rgba(0, 119, 204, 0.16);
}
input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.10);
}

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 84px; }
.toggle-password {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 40px;
  min-width: 64px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--accent-dk);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.toggle-password:hover { background: var(--accent-tint); }

.caps-hint, .field-error {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}
.caps-hint { color: var(--warn); }
.field-error { color: var(--danger); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: -4px;
}
.checkbox-label input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent-dk);
  cursor: pointer;
  flex: none;
}

/* ── Button ─────────────────────────────────────────────── */
.login-btn {
  position: relative;
  height: 54px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-field);
  background: var(--accent-dk);
  color: #ffffff;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(10, 22, 40, 0.10), 0 6px 16px -6px rgba(0, 119, 204, 0.55);
  transition: background-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.login-btn:hover { background: var(--accent-deeper); }
.login-btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(10, 22, 40, 0.12); }
.login-btn:disabled { cursor: progress; background: var(--accent-deeper); }
.login-btn[aria-busy="true"] .btn-text::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: riq-spin 700ms linear infinite;
}
@keyframes riq-spin { to { transform: rotate(360deg); } }

/* ── Messages ───────────────────────────────────────────── */
.login-message {
  padding: 12px 14px;
  border-radius: var(--radius-field);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
}
.login-message-error   { background: var(--danger-tint);  border-color: var(--danger-border);  color: var(--danger); }
.login-message-success { background: var(--success-tint); border-color: var(--success-border); color: var(--success); }
.login-message-info    { background: #eef7fd;            border-color: #b9dcf3;               color: var(--accent-deeper); }
.login-message:not([hidden]) { animation: riq-rise 260ms var(--ease); }
@keyframes riq-rise { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Help + footer ──────────────────────────────────────── */
.signin-help {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.signin-help a { font-weight: 500; white-space: nowrap; }

.signin-alt {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.signin-alt a { font-weight: 600; }

.signin-footer {
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.signin-footer p { margin: 0; }
.signin-footer a { color: inherit; }

/* ── Phones ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .signin { padding-top: 22px; }
  .signin-brand { margin-bottom: 18px; }
  .signin-brand img { width: 176px; }
  .signin-panel { padding: 24px 20px 20px; border-radius: 18px; }
  .signin-title { font-size: 1.4375rem; }
  .signin-lede { margin-bottom: 20px; font-size: 0.9375rem; }
  .login-form { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
