/* ============================================================
   Auth screens (login / register / profile)
   Full-screen modal overlay similar to paywall
   ============================================================ */

.auth-screen {
  position: fixed;
  inset: 0;
  /* Above every content overlay (ar-screens 235, tab bar 240, ask 245) but
     below the audio player (250): login must be reachable from ANY screen —
     at 230 it opened invisibly BEHIND the Cordeo chat (bug 2026-07-02). */
  z-index: 248;
  background: linear-gradient(170deg, #1f4c84 0%, #123c68 50%, #0b2745 100%);
  color: #fff;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-screen.open { display: flex; animation: authFade 0.3s ease-out; }
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }

.auth-top {
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-close {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
}

.auth-body {
  flex: 1;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
}
.auth-logo {
  display: flex;
  justify-content: center;
  margin: 12px 0 24px;
}
.auth-logo img {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 8px;
}
.auth-sub {
  font-size: 0.95rem;
  text-align: center;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  margin: 0 0 28px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.auth-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.auth-field input {
  background: rgba(255,255,255,0.10);
  border: 1.5px solid rgba(255,255,255,0.20);
  color: #fff;
  padding: 13px 14px;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.auth-field input::placeholder { color: rgba(255,255,255,0.4); }
.auth-field input:focus {
  border-color: #f5d77a;
  background: rgba(255,255,255,0.15);
}

.auth-error {
  background: rgba(220, 53, 69, 0.18);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #ffb3ba;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: none;
}
.auth-error.show { display: block; }

.auth-cta {
  width: 100%;
  background: #f5d77a;
  color: #123c68;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.auth-cta:active { transform: scale(0.98); }
.auth-cta[disabled] { opacity: 0.6; cursor: not-allowed; }

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}
.auth-switch button {
  background: none;
  border: none;
  color: #f5d77a;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  text-decoration: underline;
  padding: 0;
}

.auth-divider {
  text-align: center;
  margin: 22px 0 18px;
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  position: relative;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: rgba(255,255,255,0.15);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-oauth button {
  background: #fff;
  color: #1f2d3d;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
}
.auth-oauth button:active { background: #f5f7fa; }
.auth-oauth .apple { background: #000; color: #fff; }

.auth-fineprint {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin-top: 14px;
}
.auth-fineprint a { color: #f5d77a; text-decoration: none; }

/* Profile (logged-in state in Cuenta tab) */
.profile-loggedin {
  background: linear-gradient(135deg, #1f4c84 0%, #123c68 100%);
  color: #fff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(245,215,122,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f5d77a;
  flex-shrink: 0;
}
.profile-info {
  flex: 1;
  min-width: 0;
}
.profile-info .name {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-info .email {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.78);
  margin: 0;
}
.profile-info .badge {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(245,215,122,0.25);
  color: #f5d77a;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 6px;
  font-weight: 600;
}

/* Password eye toggle ─────────────────────────────────── */
.auth-pw-wrap {
  position: relative;
  display: flex;
}
.auth-pw-wrap input {
  padding-right: 48px;
  width: 100%;
}
.auth-pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-pw-toggle:hover { background: rgba(255,255,255,0.08); color: #fff; }
.auth-pw-toggle:active { transform: translateY(-50%) scale(0.95); }
.auth-pw-toggle[aria-pressed="true"] { color: var(--app-gold, #d9a028); }
