/* ============================================================================
   Form and sign-in components: fields, inputs, radios, the password show/hide
   control, the account-type chooser and status alerts.

   Loaded by resources/views/layouts/landing.blade.php, between um-chrome.css
   and landing.css. Deliberately unthemed: it reads --auth-* custom properties
   that landing.css sets, so the same components can be restyled per page group
   without editing this file. (Was auth.css.)

   The verification-gate and signed-in-bar rules are kept but currently unused:
   UMGVS has its own verification flow, and the ported one was deferred.
   ============================================================================ */
/* Anything marked hidden stays hidden, even if a class gives it a display value. */
[hidden] { display: none !important; }

:root {
  --auth-ink: #10213f;
  --auth-muted: #5a6478;
  --auth-line: #d5dbe5;
  --auth-soft: #f4f6fa;
  --auth-accent: #192f59;
  --auth-accent-soft: #e8edf6;
  --auth-alt: #8a5a00;
  --auth-alt-soft: #fff4cc;
  --auth-radius: 8px;
  --auth-card-radius: 12px;
}

.btn-block { width: 100%; justify-content: center; }

/* Password field with show/hide */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 52px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 6px; background: none; color: var(--auth-muted); font-size: 18px; cursor: pointer;
}
.password-toggle:hover { color: var(--auth-ink); background: var(--auth-soft); }
.password-toggle[aria-pressed="true"] { color: var(--auth-accent); }

.login-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: -2px 0 20px; font-size: .95rem; }
.check, .radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input, .radio input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--auth-accent); }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--auth-muted); font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--auth-line); }

.btn.btn-google { background: #fff; border: 1px solid var(--auth-line); color: #1f1f1f; font-weight: 600; box-shadow: none; }
.btn.btn-google:hover { background: #f8f9fa; border-color: #c4c9d2; color: #1f1f1f; }
.g-logo { width: 18px; height: 18px; flex: none; }

.form-foot { margin: 18px 0 0; text-align: center; color: var(--auth-muted); font-size: .95rem; }
.optional { font-weight: 400; color: var(--auth-muted); font-size: .9em; }

/* Registration form layout */
.form-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-group + .form-group { margin-top: 22px; }
.form-group > legend {
  width: 100%; margin-bottom: 16px; padding: 0 0 8px; border-bottom: 1px solid var(--auth-line);
  font-weight: 700; font-size: 1.05rem; color: var(--auth-ink);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-row.title-row { grid-template-columns: 150px 1fr; }
.radio-group { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.radio-group > legend { margin-bottom: 8px; padding: 0; font-weight: 600; color: var(--auth-ink); }
.radio-group .radio, .field .check { display: flex; margin-bottom: 8px; font-weight: 400; }
select.input {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6478' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
textarea.input { resize: vertical; min-height: 84px; }
select.input:disabled { background-color: var(--auth-soft); color: var(--auth-ink); opacity: 1; cursor: not-allowed; }

.field-error { margin: 6px 0 0; color: #b42318; font-size: .9rem; }
.field-error a { color: inherit; font-weight: 600; }
.input[aria-invalid="true"] { border-color: #d92d20; }

/* Account type chooser */
.choice-wrap { max-width: 780px; }
.choice-list { display: grid; gap: 14px; }
.choice {
  display: flex; align-items: center; gap: 18px; padding: 20px 22px;
  background: #fff; border: 1px solid var(--auth-line); border-radius: var(--auth-card-radius);
  color: var(--auth-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.choice:hover { border-color: var(--auth-accent); box-shadow: 0 8px 22px rgba(16,33,63,.08); transform: translateY(-2px); color: var(--auth-ink); }
.choice-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--auth-accent-soft); color: var(--auth-accent); font-size: 24px; }
.choice-icon.org { background: var(--auth-alt-soft); color: var(--auth-alt); }
.choice-text strong { display: block; font-size: 1.1rem; margin-bottom: 2px; }
.choice-text span { display: block; color: var(--auth-muted); font-size: .95rem; }
.choice-go { margin-left: auto; flex: none; font-size: 20px; color: var(--auth-muted); transition: transform .15s, color .15s; }
.choice:hover .choice-go { color: var(--auth-accent); transform: translateX(3px); }
.choice-foot { margin: 22px 0 0; color: var(--auth-muted); }

/* Verification gate and signed-in bar */
.auth-gate { max-width: 680px; margin: 0 auto; padding: 40px 32px; text-align: center; }
.gate-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--auth-accent-soft); color: var(--auth-accent); font-size: 30px; }
.auth-gate p { max-width: 34em; margin: 0 auto 24px; color: var(--auth-muted); }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.session-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px;
  margin-bottom: 24px; padding: 12px 16px; border: 1px solid var(--auth-line); border-radius: var(--auth-radius);
  background: var(--auth-accent-soft); color: var(--auth-ink);
}
.session-who { display: inline-flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.session-who .icon { color: var(--auth-accent); font-size: 18px; }
.session-out { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--auth-accent); font: inherit; font-weight: 600; cursor: pointer; }
.session-out:hover { text-decoration: underline; }

/* Status messages (e.g. "Application received") */
.alert { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; padding: 14px 16px; border: 1px solid; border-radius: var(--auth-radius); }
.alert:focus { outline: none; }
.alert .icon { flex: none; font-size: 20px; margin-top: 2px; }
.alert strong { display: block; }
.alert p { margin: 2px 0 0; }
.alert-success { background: #e7f6ec; border-color: #b7e2c4; color: #14532d; }
.alert-success .icon { color: #16a34a; }
.alert-error { background: #fdecec; border-color: #f5c2c2; color: #8a1c1c; }
@media (max-width: 640px) {
  .field-row, .field-row.title-row { grid-template-columns: 1fr; }
  .auth-gate { padding: 30px 20px; }
  .gate-actions .btn { width: 100%; justify-content: center; }
  .choice { padding: 16px; gap: 14px; }
}
