/* ============================================
   Byte-Sized AI — Auth, COPPA & Payments Styles
   ============================================ */

/* ---- Backdrop ---- */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 10, 40, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: authFadeIn 0.25s ease-out;
  overflow-y: auto;
}

@keyframes authFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Modal Card ---- */
.auth-modal {
  background: linear-gradient(145deg, #1e1b3a 0%, #2a2650 100%);
  border: 1px solid rgba(124, 92, 224, 0.2);
  border-radius: 24px;
  max-width: 440px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(124, 92, 224, 0.1);
  animation: authSlideUp 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.coppa-modal {
  max-width: 500px;
}

.paywall-modal {
  max-width: 520px;
}

/* ---- Modal Header ---- */
.auth-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.auth-modal-header h2 {
  font-family: 'Fredoka', 'Quicksand', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
}

.auth-modal-header .auth-modal-sub {
  font-family: 'Quicksand', sans-serif;
  color: #a8a0c8;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* ---- Modal Body ---- */
.auth-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---- Form Elements ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c8c0e0;
}

.auth-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
}

.auth-input:focus {
  border-color: #7c5ce0;
  background: rgba(124, 92, 224, 0.08);
}

.auth-input::placeholder {
  color: #6a6090;
}

.auth-input option {
  background: #2a2650;
  color: #fff;
}

/* Code input */
.code-input-group {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0;
}

.code-input {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  padding: 0.75rem 1rem;
  max-width: 260px;
  font-family: 'Fredoka', monospace;
}

/* ---- Buttons ---- */
.auth-btn {
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 14px;
  font-family: 'Fredoka', 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

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

.auth-btn-primary {
  background: linear-gradient(135deg, #7c5ce0, #9370f0);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124, 92, 224, 0.3);
}

.auth-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b6bf0, #a080ff);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 92, 224, 0.4);
}

.auth-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #c8c0e0;
  border: 1px solid rgba(255,255,255,0.1);
}

.auth-btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.auth-btn-text {
  background: none;
  color: #a8a0c8;
  padding: 0.5rem;
  font-size: 0.9rem;
}

.auth-btn-text:hover:not(:disabled) {
  color: #c8c0e0;
}

.auth-btn-skip {
  font-size: 0.8rem;
  color: #6a6090;
  margin-top: 0.25rem;
}

.auth-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
}

/* ---- Divider ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.auth-divider span {
  font-size: 0.8rem;
  color: #6a6090;
}

/* ---- Error / Success ---- */
.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  color: #f87171;
  font-size: 0.85rem;
  font-family: 'Quicksand', sans-serif;
}

.auth-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  color: #4ade80;
  font-size: 0.85rem;
  font-family: 'Quicksand', sans-serif;
}

/* ---- Checkbox ---- */
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.82rem;
  color: #a8a0c8;
  line-height: 1.5;
  margin: 0.25rem 0;
}

.auth-checkbox input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #7c5ce0;
}

/* ---- COPPA Info Box ---- */
.coppa-info-box {
  background: rgba(124, 92, 224, 0.06);
  border: 1px solid rgba(124, 92, 224, 0.12);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

.coppa-info-box h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #c8c0e0;
  margin: 0 0 0.5rem;
}

.coppa-info-box h3:not(:first-child) {
  margin-top: 0.75rem;
}

.coppa-info-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.coppa-info-box li {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  color: #a8a0c8;
  padding: 0.2rem 0 0.2rem 1.25rem;
  position: relative;
}

.coppa-info-box li::before {
  content: '•';
  position: absolute;
  left: 0.25rem;
  color: #7c5ce0;
}

.coppa-verify-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  color: #a8a0c8;
  text-align: center;
  margin: 0.25rem 0;
}

.coppa-verify-text strong {
  color: #c8c0e0;
}

/* ---- Plan Cards (Paywall) ---- */
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.plan-card {
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.plan-card:hover {
  border-color: rgba(124, 92, 224, 0.3);
}

.plan-card.selected {
  border-color: #7c5ce0;
  background: rgba(124, 92, 224, 0.08);
  box-shadow: 0 0 20px rgba(124, 92, 224, 0.15);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  color: #a8a0c8;
  margin-bottom: 0.35rem;
}

.plan-price {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.plan-price span {
  font-size: 0.9rem;
  color: #6a6090;
  font-weight: 400;
}

.plan-desc {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.8rem;
  color: #6a6090;
  margin-top: 0.25rem;
}

/* ---- Plan Features ---- */
.plan-features {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.25rem 0;
}

.plan-feature {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.88rem;
  color: #c8c0e0;
  padding-left: 0.25rem;
}

/* ---- Settings ---- */
.settings-section {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
}

.settings-section h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #7c5ce0;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
}

.settings-label {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  color: #a8a0c8;
}

.settings-value {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 600;
}

.settings-note {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.78rem;
  color: #6a6090;
  margin-top: 0.25rem;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ---- Help Button ---- */
.auth-btn-help {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.15), rgba(20, 184, 166, 0.15));
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #c4b5fd;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.auth-btn-help:hover {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.25), rgba(20, 184, 166, 0.25));
  border-color: rgba(167, 139, 250, 0.4);
  color: #e0d5ff;
  transform: translateY(-1px);
}

/* ---- Subscription Status Badges ---- */
.sub-status {
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
}

.sub-status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.sub-status-free {
  background: rgba(124, 92, 224, 0.15);
  color: #9370f0;
}

.sub-info {
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.sub-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  color: #a8a0c8;
}

/* ---- Lock Badge on Episode Cards ---- */
.episode-lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ---- Settings Gear in Header ---- */
.home-settings-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.home-settings-btn:hover {
  opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .auth-modal {
    padding: 1.5rem 1.25rem;
    border-radius: 20px;
    max-height: 95vh;
  }

  .auth-modal-header h2 {
    font-size: 1.3rem;
  }

  .plan-cards {
    grid-template-columns: 1fr;
  }

  .code-input {
    font-size: 1.5rem;
    letter-spacing: 0.4em;
  }
}
