/* ============================================================================
   Answers — Profile page
   Optional personalization details for signed-in users, saved via
   /api/profile (see profile.js + answers-profile.js). Not a primary-nav
   screen (reached from the header avatar), so the bottom nav below has no
   active item, same treatment as Sal Klita / Office Finder.
   ========================================================================== */

/* Depends on design-tokens.css and answers-shell.css being <link>ed first (no @import:
   imported URLs can't carry the ?v= cache-busting version the HTML uses). */

.profile-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 20px 28px;
}

.profile-title {
  margin: 0 0 8px;
  font-family: var(--ans-font-display);
  font-size: 26px;
  color: var(--ans-navy-900);
}

.profile-intro {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ans-slate);
}

.profile-message {
  font-size: 13.5px;
  color: var(--ans-slate);
}

/* :not([hidden]) -- a bare .profile-form{display:flex} would outrank the
   browser's own [hidden]{display:none} UA rule (a class beats an attribute
   selector), so toggling form.hidden from JS would silently do nothing. */
.profile-form:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profile-field span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ans-slate);
}

.profile-field input[type="text"],
.profile-field input[type="tel"],
.profile-field input[type="date"],
.profile-field select {
  border: 1px solid var(--ans-line);
  border-radius: var(--ans-r-input);
  padding: 11px 12px;
  font: 14px/1.4 var(--ans-font-body);
  color: var(--ans-ink);
  background: var(--ans-surface);
}

.profile-field input:focus,
.profile-field select:focus {
  outline: 2px solid var(--ans-blue-500);
  outline-offset: -1px;
}

.profile-phone {
  display: flex;
  gap: 8px;
}
.profile-phone select {
  flex: 0 0 auto;
  width: 128px;
  font-size: 12.5px;
  padding-left: 8px;
  padding-right: 6px;
}
.profile-phone input[type="tel"] {
  flex: 1;
  min-width: 0;
}

.profile-field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.profile-field--checkbox span { font-weight: 500; color: var(--ans-ink); font-size: 13.5px; }

.profile-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 4px;
  padding: 12px;
  background: var(--ans-canvas);
  border-radius: var(--ans-r-card);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ans-ink);
}
.profile-consent input { margin-top: 2px; flex-shrink: 0; }

.profile-status {
  margin: 0;
  min-height: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ans-green);
}
.profile-status[data-error] { color: #a3282c; }

.profile-save {
  border: 0;
  cursor: pointer;
  background: var(--ans-blue-500);
  color: #fff;
  font: 600 14.5px var(--ans-font-body);
  padding: 13px;
  border-radius: var(--ans-r-input);
}
.profile-save:disabled { opacity: .6; cursor: default; }

/* :not([hidden]) -- same reason as .profile-form above. */
.profile-danger:not([hidden]) {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--ans-line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-danger__btn {
  border: 1px solid var(--ans-line);
  cursor: pointer;
  background: var(--ans-surface);
  color: var(--ans-slate);
  font: 600 13px var(--ans-font-body);
  padding: 10px 16px;
  border-radius: var(--ans-r-input);
}

/* Signed out: why sign in, then real buttons. */
.profile-signin:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--ans-r-card);
  background: var(--ans-surface);
  box-shadow: var(--ans-shadow-card);
}
.profile-signin__why {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ans-ink);
}
.profile-signin__buttons {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ans-slate);
}
.profile-signin__btn {
  display: block;
  padding: 12px 16px;
  border-radius: var(--ans-r-input);
  background: var(--ans-grad-user);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  text-decoration: none;
}
.profile-signin__btn:focus-visible { outline: 2px solid var(--ans-blue-300); outline-offset: 2px; }

/* Link to About (about.html) at the foot of the profile. */
.profile-about { margin: 22px 0 8px; text-align: center; font-size: 13.5px; }
.profile-about a { color: var(--ans-blue-500); font-weight: 600; }
