/* ──────────────────────────────────────────────────────────────
   Login — calm light field coherent with the rest of the app.
   Flat house style (User_Base_Bare kills all box-shadow):
   separation = 1px --line + tonal paper layering, never shadow.
   Tokens only, no hardcoded hex. Focus = base :focus-visible.
   ────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--paper-2);
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

/* Auth card — a quiet document resting on the paper field */
#auth-container {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 408px;
  padding: 40px 36px;
  text-align: center;
  color: var(--ink-700);
}

/* Brand lockup */
.logo {
  width: 84px;
  height: auto;
  display: block;
  margin: 0 auto 14px;
}
.auth-tagline {
  margin: 0 0 26px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink-400);
}

/* Login / Register — segmented control (multi-cue active state) */
#formTitle {
  display: flex;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: default;
}
#formTitle .title-tab {
  flex: 1 1 0;
  padding: 9px 0;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-400);
  cursor: pointer;
  user-select: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
#formTitle .title-tab:hover { color: var(--ink-700); }
#formTitle .title-tab.active {
  background: var(--white);
  color: var(--accent);
  border-color: var(--line);
}

/* Google Sign-In (Google renders its own button, width set in JS) */
.google-auth-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.google-auth-container #google-signin-btn {
  display: flex;
  justify-content: center;
  width: 100%;
}
.google-auth-container #google-signin-btn > div {
  width: 100% !important;
  max-width: 100%;
  border-radius: var(--r-sm) !important;
}
.google-auth-container #google-signin-btn iframe {
  border-radius: var(--r-sm) !important;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 18px 0;
  color: var(--ink-400);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  min-width: 0;
  height: 1px;
  background: var(--line);
}

/* Form */
form {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.input-group {
  margin-bottom: 16px;
  text-align: left;
  width: 100%;
}
label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  letter-spacing: .1px;
}
input,
.details-form textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-900);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .15s ease, background .15s ease;
}
input::placeholder,
.details-form textarea::placeholder { color: var(--ink-300); }
input:focus,
.details-form textarea:focus { border-color: var(--accent); }
.details-form textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.55;
}

/* Primary submit (authForm + detailsForm — one button vocabulary) */
button[type="submit"] {
  width: 100%;
  margin-top: 4px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: var(--accent);
  cursor: pointer;
  transition: background .15s ease;
}
button[type="submit"]:hover,
button[type="submit"]:active { background: var(--accent-strong); }

/* Tertiary text actions */
#passwordToggleForm {
  display: inline-block;
  margin: 18px auto 0;
  padding: 4px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}
#passwordToggleForm:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* Optional codes (register only) */
#useCodeToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px auto 14px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
#useCodeToggle:hover {
  background: var(--paper-3);
  color: var(--ink-700);
}
#hideCodeToggle {
  display: inline-block;
  margin-top: 6px;
  padding: 4px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-400);
  cursor: pointer;
}
#hideCodeToggle:hover {
  color: var(--ink-700);
  text-decoration: underline;
}

/* Inline form feedback (JS sets colour; aria-live announces it) */
#responseMessage {
  margin: 14px 0 0;
  min-height: 1.2em;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

@media (max-width: 480px) {
  #auth-container { padding: 28px 22px; }
}

/* ── Overlays: reset password + complete profile ── */
.popup,
.details-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1002;
  padding: 24px;
  background: rgba(10, 23, 51, .45);
  align-items: center;
  justify-content: center;
}
.popup-content,
.details-popup-content {
  position: relative;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: left;
}
.popup-content {
  max-width: 380px;
  padding: 28px;
  text-align: center;
}
.details-popup-content {
  max-width: 720px;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}
.popup-content h2,
.details-popup-content h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
}
.popup-content p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-500);
}
.popup-close,
.details-popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-400);
  cursor: pointer;
}
.popup-close:hover,
.details-popup-close:hover {
  color: var(--ink-900);
  background: var(--paper-2);
}
#sendResetLink {
  width: 100%;
  margin-top: 16px;
  padding: 11px 18px;
  border: 0;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: var(--accent);
  cursor: pointer;
  transition: background .15s ease;
}
#sendResetLink:hover { background: var(--accent-strong); }

/* Complete-profile form internals */
.details-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.details-form .input-group { margin-bottom: 0; width: 100%; }
.double-input-row {
  display: flex;
  gap: 14px;
  width: 100%;
}
.double-input-row .input-group { flex: 1 1 0; min-width: 0; }

.education-entry,
.experience-entry {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.education-entry input[type="text"],
.experience-entry input[type="text"] {
  flex: 2 1 0;
  min-width: 0;
  font-size: 13px;
  padding: 9px 12px;
}
.education-entry input[type="month"],
.experience-entry input[type="month"] { display: none; }
.fake-month-box {
  flex: 0 0 86px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-700);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease;
}
.fake-month-box.placeholder {
  color: var(--ink-300);
  font-style: italic;
}
.fake-month-box:focus,
.fake-month-box.active { border-color: var(--accent); }
.remove-education,
.remove-experience {
  flex: 0 0 auto;
  padding: 6px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink-400);
  cursor: pointer;
}
.remove-education:hover,
.remove-experience:hover {
  color: var(--ink-900);
  background: var(--paper-2);
}
#add-education,
#add-experience {
  margin-top: 6px;
  padding: 8px 12px;
  background: none;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
#add-education:hover,
#add-experience:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.month-popup {
  position: fixed;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  max-width: 320px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.month-popup select {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  color: var(--ink-900);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.month-popup button {
  margin-left: 4px;
  padding: 7px 12px;
  background: var(--accent);
  color: var(--white);
  border: 0;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.month-popup button:hover { background: var(--accent-strong); }
.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  max-height: 184px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.autocomplete-suggestion {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink-700);
  cursor: pointer;
}
.autocomplete-suggestion:hover,
.autocomplete-suggestion.active {
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 560px) {
  .double-input-row { flex-direction: column; gap: 14px; }
  .education-entry,
  .experience-entry { flex-wrap: wrap; }
}
