/* ============================================================
   Convene — Auth Modal
   Matches the landing page design system (Lora / DM Sans /
   Space Mono, green palette, CSS variables).
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 40, 20, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.auth-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Dialog ──────────────────────────────────────────────── */
.auth-dialog {
  background: var(--white, #fff);
  border: 1.5px solid var(--border2, rgba(30,60,30,0.16));
  border-radius: 22px;
  box-shadow: 0 32px 100px rgba(20,50,20,0.22);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px 36px;
  position: relative;
  transform: translateY(18px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34,1.3,0.64,1), opacity 0.25s ease;
  opacity: 0;
}
.auth-overlay.open .auth-dialog {
  transform: none;
  opacity: 1;
}

/* ── Close button ────────────────────────────────────────── */
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border2, rgba(30,60,30,0.16));
  background: var(--bg, #F5F7F2);
  color: var(--muted, #7A8C74);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.auth-close:hover {
  background: var(--green-lt, #E8F5EE);
  color: var(--green, #1F7A45);
  border-color: rgba(31,122,69,0.3);
}

/* ── Logo mark ───────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
}
.auth-logo-mark {
  width: 30px;
  height: 30px;
  background: var(--green, #1F7A45);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(31,122,69,0.3);
  flex-shrink: 0;
}
.auth-logo-name {
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #1A2416);
  letter-spacing: -0.03em;
}

/* ── Heading ─────────────────────────────────────────────── */
.auth-heading {
  font-family: var(--serif, 'Lora', Georgia, serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text, #1A2416);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 14px;
  color: var(--muted, #7A8C74);
  margin-bottom: 28px;
  line-height: 1.6;
}
.auth-sub a {
  color: var(--green, #1F7A45);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.auth-sub a:hover { text-decoration: underline; }

/* ── Tab switcher ────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: var(--bg2, #ECEEE9);
  border-radius: 11px;
  padding: 3px;
  margin-bottom: 26px;
  gap: 3px;
}
.auth-tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-family: var(--sans, 'DM Sans', sans-serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted, #7A8C74);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.auth-tab.active {
  background: var(--white, #fff);
  color: var(--text, #1A2416);
  box-shadow: 0 1px 6px rgba(20,50,20,0.1);
  font-weight: 600;
}

/* ── Form panels ─────────────────────────────────────────── */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ── Field ───────────────────────────────────────────────── */
.auth-field {
  margin-bottom: 14px;
}
.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2, #3D4F38);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.auth-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg, #F5F7F2);
  border: 1.5px solid var(--border2, rgba(30,60,30,0.16));
  border-radius: 10px;
  font-family: var(--sans, 'DM Sans', sans-serif);
  font-size: 15px;
  color: var(--text, #1A2416);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}
.auth-input::placeholder { color: var(--muted, #7A8C74); }
.auth-input:focus {
  border-color: var(--green, #1F7A45);
  box-shadow: 0 0 0 3px rgba(31,122,69,0.1);
  background: var(--white, #fff);
}

/* ── Password wrapper (with show/hide) ───────────────────── */
.auth-pw-wrap {
  position: relative;
}
.auth-pw-wrap .auth-input {
  padding-right: 44px;
}
.auth-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted, #7A8C74);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.auth-pw-toggle:hover { color: var(--text, #1A2416); }

/* ── Forgot link ─────────────────────────────────────────── */
.auth-forgot {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--green, #1F7A45);
  font-weight: 500;
  text-decoration: none;
  margin-top: -8px;
  margin-bottom: 20px;
  cursor: pointer;
}
.auth-forgot:hover { text-decoration: underline; }

/* ── Submit button ───────────────────────────────────────── */
.auth-submit {
  width: 100%;
  padding: 13px 0;
  background: var(--green, #1F7A45);
  border: none;
  border-radius: 11px;
  color: #fff;
  font-family: var(--sans, 'DM Sans', sans-serif);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(31,122,69,0.28);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-submit:hover {
  background: #186038;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(31,122,69,0.36);
}
.auth-submit:active { transform: none; }
.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ── Divider ─────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted, #7A8C74);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2, rgba(30,60,30,0.16));
}

/* ── Social buttons ──────────────────────────────────────── */
.auth-socials {
  display: flex;
  gap: 8px;
}
.auth-social-btn {
  flex: 1;
  padding: 10px 0;
  background: var(--bg, #F5F7F2);
  border: 1.5px solid var(--border2, rgba(30,60,30,0.16));
  border-radius: 10px;
  font-family: var(--sans, 'DM Sans', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2, #3D4F38);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.auth-social-btn:hover {
  background: var(--white, #fff);
  border-color: var(--border2, rgba(30,60,30,0.25));
  transform: translateY(-1px);
}

/* ── Terms note ──────────────────────────────────────────── */
.auth-terms {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted, #7A8C74);
  line-height: 1.6;
  margin-top: 14px;
}
.auth-terms a {
  color: var(--green, #1F7A45);
  text-decoration: none;
  font-weight: 500;
}
.auth-terms a:hover { text-decoration: underline; }

/* ── Error / success message ─────────────────────────────── */
.auth-message {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
  display: none;
}
.auth-message.error {
  display: block;
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: #c0392b;
}
.auth-message.success {
  display: block;
  background: var(--green-lt, #E8F5EE);
  border: 1px solid rgba(31,122,69,0.3);
  color: var(--green, #1F7A45);
}

/* ── Spinner (inside submit button) ─────────────────────── */
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-dialog {
    padding: 32px 22px 28px;
    border-radius: 18px;
  }
  .auth-socials { flex-direction: column; }
}

/* ── Email / Phone method toggle ─────────────────────────── */
.auth-method-toggle {
  display: flex;
  background: var(--bg2, #ECEEE9);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 16px;
  gap: 3px;
}
.auth-method-btn {
  flex: 1;
  padding: 7px 0;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-family: var(--sans, 'DM Sans', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #7A8C74);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.auth-method-btn.active {
  background: var(--white, #fff);
  color: var(--text, #1A2416);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(20,50,20,0.1);
}

/* ── Phone input row ─────────────────────────────────────── */
.auth-phone-wrap {
  display: flex;
  gap: 8px;
}
.auth-dial {
  width: 100px;
  flex-shrink: 0;
  padding: 11px 10px;
  background: var(--bg, #F5F7F2);
  border: 1.5px solid var(--border2, rgba(30,60,30,0.16));
  border-radius: 10px;
  font-family: var(--sans, 'DM Sans', sans-serif);
  font-size: 13px;
  color: var(--text, #1A2416);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}
.auth-dial:focus {
  border-color: var(--green, #1F7A45);
  box-shadow: 0 0 0 3px rgba(31,122,69,0.1);
}
.auth-phone-wrap .auth-input { flex: 1; }

/* ── OTP note ────────────────────────────────────────────── */
.auth-otp-note {
  font-size: 12px;
  color: var(--muted, #7A8C74);
  margin-top: 7px;
  line-height: 1.5;
}

/* ── 3-column social row ─────────────────────────────────── */
.auth-socials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 380px) {
  .auth-socials { grid-template-columns: 1fr; }
}

/* ── OTP sent message ────────────────────────────────────── */
.auth-otp-sent {
  font-size: 14px;
  color: var(--text2, #3D4F38);
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--green-lt, #E8F5EE);
  border: 1px solid rgba(31,122,69,0.2);
  border-radius: 10px;
}

/* ── 6-box OTP input row ─────────────────────────────────── */
.auth-otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.auth-otp-box {
  width: 44px;
  height: 52px;
  text-align: center;
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #1A2416);
  background: var(--bg, #F5F7F2);
  border: 1.5px solid var(--border2, rgba(30,60,30,0.16));
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.auth-otp-box:focus {
  border-color: var(--green, #1F7A45);
  box-shadow: 0 0 0 3px rgba(31,122,69,0.12);
  background: var(--white, #fff);
}
.auth-otp-box:not(:placeholder-shown) {
  background: var(--white, #fff);
  border-color: var(--green, #1F7A45);
}

/* ── Resend + back links ─────────────────────────────────── */
.auth-otp-resend {
  text-align: center;
  font-size: 13px;
  color: var(--muted, #7A8C74);
  margin-top: 14px;
}
.auth-otp-resend-link {
  color: var(--green, #1F7A45);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.auth-otp-resend-link:hover { text-decoration: underline; }

.auth-back {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted, #7A8C74);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-back:hover { color: var(--text, #1A2416); }

/* ── Responsive OTP boxes ────────────────────────────────── */
@media (max-width: 380px) {
  .auth-otp-box { width: 38px; height: 46px; font-size: 18px; }
  .auth-otp-row { gap: 6px; }
}

/* ── OTP: single real input + decorative segment overlay ────── */

/* Remove old separate-box styles that no longer apply */
.auth-otp-row {
  position: relative;
  display: flex;
  justify-content: center;
}

/* The real input — invisible but covers the whole row for input/autofill */
.auth-otp-real {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  background: transparent;
  cursor: text;
  font-size: 16px; /* prevents iOS zoom */
  z-index: 2;
  caret-color: transparent;
  -webkit-appearance: none;
  outline: none;
  /* letter-spacing trick: spread chars to align under each segment */
  letter-spacing: 3.2em;
  padding-left: 1.1em;
  color: transparent;
}

/* The visual segments */
.auth-otp-segments {
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 1;
}

.auth-otp-seg {
  width: 44px;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid var(--border2, rgba(30,60,30,0.16));
  background: var(--bg, #F5F7F2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #1A2416);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

/* Digit entered */
.auth-otp-seg.filled {
  background: var(--white, #fff);
  border-color: var(--green, #1F7A45);
}

/* Cursor position — the segment about to receive next digit */
.auth-otp-seg.active {
  border-color: var(--green, #1F7A45);
  box-shadow: 0 0 0 3px rgba(31,122,69,0.12);
  background: var(--white, #fff);
}

/* Keep row height consistent */
.auth-otp-row {
  height: 52px;
  margin-bottom: 4px;
}

@media (max-width: 380px) {
  .auth-otp-seg { width: 38px; height: 46px; font-size: 18px; }
  .auth-otp-segments { gap: 6px; }
  .auth-otp-row { height: 46px; }
}
