/* =============================================================================
   mi-auth-modal.css — Iter 25JN
   The sign-in / create-account / reset dialog (#authModal). Moved out of
   style.css so every page can show it (mi-auth-modal.js builds the dialog on
   pages other than /markets; /markets keeps its own markup + app.js). Loaded
   on every page through mi-nav-snippet.html. Theme variables carry fallbacks
   because only style.css pages define them.
   ============================================================================= */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-modal-card {
  background: #141417;
  border: 1px solid #24242a;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 28px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-secondary, #b0bec5);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.auth-modal-close:hover {
  color: var(--text-primary, #e0e0e0);
  background: var(--bg-tertiary, #222226);
}

.auth-modal-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary, #E0E0E0);
  text-align: center;
  margin: 0 0 20px;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  line-height: 1;
}

.auth-brand-mark {
  display: block;
  flex: 0 0 auto;
}

.auth-brand-name {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.auth-brand-name-strong {
  color: #ffffff;
  font-weight: 800;
}

.auth-brand-name-light {
  color: #6FBCC9;
  font-weight: 400;
}

.auth-brand-logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

.auth-field {
  margin-bottom: 12px;
}

.auth-input {
  width: 100%;
  background: #222226;
  border: 1px solid #2e2e34;
  border-radius: 8px;
  padding: 14px 16px;
  color: #e0e0e0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #4a4a52;
  background: #26262b;
}

.auth-input::placeholder {
  color: #7a7a82;
}

.auth-pw-wrap {
  position: relative;
}

.auth-pw-wrap .auth-input {
  padding-right: 52px;
}

.auth-pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: 6px;
  color: #8a8a92;
  cursor: pointer;
  padding: 0;
}

.auth-pw-toggle:hover,
.auth-pw-toggle[aria-pressed="true"] {
  color: #e0e0e0;
}

.auth-pw-toggle:focus-visible {
  outline: 2px solid #4f98a3;
  outline-offset: 0;
}

.auth-forgot {
  text-align: right;
  margin-top: -2px;
  margin-bottom: 10px;
}

.auth-link {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #9a9aa2;
  text-decoration: none;
}

.auth-link:hover {
  color: #e0e0e0;
}

.auth-link-underline {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: #e0e0e0;
}

.auth-link-underline:hover {
  color: #ffffff;
}

.auth-back {
  text-align: center;
  margin-top: 14px;
}

.auth-rule {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 16px 0;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px 0;
  background: #2a2a30;
  color: #f2f2f2;
  border: 1px solid #3a3a42;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 10px;
}

.auth-submit-btn:hover {
  background: #32323a;
  border-color: #45454e;
}

.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 0;
  background: transparent;
  color: #e0e0e0;
  border: 1px solid #2e2e34;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 16px;
}

.auth-oauth-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: #3a3a42;
}

.auth-oauth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-oauth-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.auth-footnote {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #8a8a92;
  margin: 0;
}

.auth-footnote .auth-link-underline {
  color: #e0e0e0;
  margin-left: 4px;
}

.auth-message {
  min-height: 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  margin-bottom: 10px;
  text-align: center;
}

.auth-message.auth-error {
  color: #C24A4A;
}

.auth-message.auth-success {
  color: #0EB35B;
}

.auth-strength-bar-wrap {
  height: 4px;
  background: #2a2a30;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.auth-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.25s, background 0.25s;
}

.auth-strength-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--text-secondary, #b0bec5);
  margin-top: 4px;
  min-height: 14px;
}

.auth-reset-info {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-secondary, #b0bec5);
  margin: 0 0 18px;
  line-height: 1.5;
}

.auth-confirm-icon {
  display: flex;
  justify-content: center;
  margin: 4px 0 14px;
  color: #4F98A3;
}

.auth-confirm-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #e8ecf1);
  text-align: center;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.auth-confirm-body {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: var(--text-secondary, #9aa7b4);
  text-align: center;
  line-height: 1.55;
  margin: 0 0 8px;
}

.auth-confirm-body strong {
  color: var(--text-primary, #e8ecf1);
  font-weight: 600;
  word-break: break-all;
}

.auth-confirm-hint {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  color: #6e7c8a;
  text-align: center;
  margin: 0 0 18px;
}

.auth-user-email {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  color: #4F98A3;
  margin-right: 6px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 767px) {
  .auth-modal-card {
    max-width: none;
    margin: 0 8px;
    padding: 24px 18px 20px;
  }
  .auth-modal-title {
    font-size: 16px;
  }
}

/* Iter 25JQ — Sign in with Apple button. Apple's guidelines: same size and
   prominence as other sign-in options; on a dark UI the white-outline style
   (black fill, white logo and text, white outline). */
.auth-apple-btn {
  background: #000;
  border-color: #e0e0e0;
  color: #fff;
}
.auth-apple-btn:hover { background: #111; border-color: #fff; }
.auth-oauth-btn + .auth-apple-btn { margin-top: -6px; }
.auth-apple-icon { width: 16px; height: 18px; color: #fff; }
