/* Adthletics - log in (sign up has css/signup.css). Loads after site.css (tokens, type,
   buttons, header and footer). */

:root {
  --paper: #fffdf8;
  --field-line: rgba(17, 17, 17, 0.22);
  --danger: #c62d2d;
  --danger-tint: rgba(198, 45, 45, 0.08);
}

.auth { padding-block: clamp(32px, 6vw, 80px) clamp(72px, 9vw, 120px); }

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

/* ---------- Left: the page's message (stays in view beside a long form) ---------- */

.auth-intro {
  container-type: inline-size;
  position: sticky;
  top: clamp(24px, 4vw, 48px);
  display: grid;
  justify-items: start;
  gap: 22px;
}

.auth-intro .eyebrow { color: var(--accent); }

/* Sized by the column (cqi): the longest word, "Adthletics.", always fits. */
.auth-title { font-size: clamp(40px, 12.5cqi, 88px); }

.auth-lead {
  max-width: 34ch;
  font-size: 19px;
  color: var(--ink-soft);
}

/* ---------- Right: the form card ---------- */

.auth-card {
  padding: clamp(24px, 4vw, 44px);
  border: 1.5px solid var(--ink);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 40px 80px -50px rgba(0, 119, 255, 0.55);
}

.form-stack {
  display: grid;
  gap: 20px;
}

.form-stack > .btn { margin-top: 8px; }

.field {
  display: grid;
  align-content: start;
  gap: 8px;
}

.auth label,
.auth .label {
  font-size: 15px;
  font-weight: 700;
}

.field-foot {
  display: flex;
  justify-content: flex-end;
  font-size: 15px;
}

/* ---------- Inputs ---------- */

.auth input:not([type="checkbox"], [type="radio"]),
.auth select {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--field-line);
  border-radius: 14px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth input::placeholder { color: rgba(17, 17, 17, 0.4); }

.auth select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23111111' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px 9px;
  cursor: pointer;
}

.auth input:not([type="checkbox"], [type="radio"]):hover,
.auth select:hover { border-color: rgba(17, 17, 17, 0.45); }

/* The focus ring is the box-shadow, so the outline can go. */
.auth input:not([type="checkbox"], [type="radio"]):focus,
.auth select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(0, 119, 255, 0.2);
}

.auth input:not([type="checkbox"], [type="radio"])[aria-invalid="true"],
.auth select[aria-invalid="true"] {
  border-color: var(--danger);
  background-color: var(--danger-tint);
}

.auth input:disabled,
.auth select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Password with a show/hide toggle inside the field. */
.pw-field { position: relative; }
.pw-field input { padding-right: 88px; }

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.pw-toggle:hover { background: rgba(0, 119, 255, 0.08); }

/* ---------- Messages and links ---------- */

.msg {
  display: none;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.5;
}

.msg.show { display: block; }

.msg.error {
  color: var(--danger);
  background: var(--danger-tint);
}

.msg.success {
  color: var(--ink);
  background: rgba(0, 119, 255, 0.1);
}

.auth-switch {
  margin-top: 22px;
  text-align: center;
  color: var(--ink-soft);
}

.auth-switch a {
  font-weight: 700;
  color: var(--ink);
  text-underline-offset: 3px;
}

.auth-switch a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-intro { position: static; }
}

@media (max-width: 560px) {
  .auth-card { padding: 22px 18px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth input,
  .auth select { transition: none; }
}
