/* Shared login / sign-up modal — single source of truth (see CL-1).
   Used by index.html (header account button, Reflect) and step.html (comments).
   Markup: _partials/auth-modal.html · behavior: _partials/auth-modal.js */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 35, 31, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--cream);
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow: 0 20px 60px rgba(38, 35, 31, 0.3);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: var(--bg-alt);
  color: var(--ink-soft);
  font-family: 'Karla', sans-serif;
  font-weight: 500;
  font-size: 14px;
  padding: 10px;
  border-radius: 999px;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--ink);
  color: var(--cream);
}

.auth-panel[hidden] {
  display: none;
}

.auth-step[hidden] {
  display: none;
}

.auth-panel label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 14px 0 6px;
}

.auth-panel label:first-of-type {
  margin-top: 0;
}

.auth-panel input,
.auth-panel select {
  width: 100%;
  font-family: 'Karla', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 12px;
}

.auth-panel input:focus,
.auth-panel select:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.otp-input {
  letter-spacing: 0.4em;
  font-family: 'Azeret Mono', ui-monospace, monospace;
  text-align: center;
}

.auth-step p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}

.auth-submit {
  width: 100%;
  margin-top: 18px;
}

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

.link-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: 'Karla', sans-serif;
  font-size: 13px;
  margin-top: 12px;
  cursor: pointer;
}

.link-btn:not(:disabled):hover {
  color: var(--ink);
  text-decoration: underline;
}

.link-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.auth-error {
  margin-top: 12px;
  font-size: 13px;
  color: #a3312a;
  background: rgba(163, 49, 42, 0.08);
  border-radius: 8px;
  padding: 9px 12px;
}

.auth-error[hidden] {
  display: none;
}

.terms-text {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 14px 0 0;
  line-height: 1.5;
}

.terms-text a {
  text-decoration: underline;
}
