/* ============================================================
   AskParent AI — Auth & Chat page styles
   Extends style.css (both must be loaded)
   ============================================================ */

/* ── AUTH PAGE ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg-gray) 40%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: white;
  border-radius: 28px;
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.13);
}
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-decoration: none;
}
.auth-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 900;
}
.auth-logo .orange { color: var(--primary); }
.auth-tagline {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.auth-tabs {
  display: flex;
  background: var(--bg-gray);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 32px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 11px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-family: inherit;
}
.auth-tab.active {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.09);
}
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255,107,0,0.10);
}
.error-msg {
  color: #D32F2F;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
}
.error-msg:empty { display: none; }
.success-msg {
  color: #2E7D32;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
  min-height: 20px;
  background: #E8F5E9;
  border-radius: 8px;
  padding: 10px 14px;
}
.btn-auth {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-auth:hover   { background: var(--primary-dark); transform: translateY(-1px); }
.btn-auth:disabled { background: #CCC; cursor: not-allowed; transform: none; }
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.auth-back-link:hover { color: var(--primary); }

/* ── CHAT NAV ──────────────────────────────────────────────── */
.chat-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 1px solid var(--border);
  height: 64px;
  flex-shrink: 0;
}
.chat-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
  gap: 14px;
  max-width: 100%;
}
.chat-nav-left  { display: flex; align-items: center; gap: 16px; min-width: 0; }
.chat-nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.chat-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 900;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.chat-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 900;
}
.chat-logo .orange { color: var(--primary); }
.balance-pill {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid var(--primary-mid);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.btn-new {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-new:hover { background: var(--primary-dark); }
.btn-logout {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--primary); color: var(--primary); }

/* ── PROFILE DROPDOWN ──────────────────────────────────────── */
.profile-wrap {
  position: relative;
}
.profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: inherit;
}
.profile-btn:hover { border-color: var(--primary); }
.profile-avatar {
  width: 30px;
  height: 30px;
  background: var(--primary);
  border-radius: 50%;
  color: white;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-chevron { font-size: 14px; color: var(--text-secondary); }

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px;
  min-width: 240px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.13);
  z-index: 300;
  animation: popIn 0.2s ease;
}
.profile-dropdown.open { display: block; }

.pd-email {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 10px 12px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.pd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
}
.pd-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.pd-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.pd-value.free   { color: #2E7D32; background: #E8F5E9; padding: 2px 10px; border-radius: 50px; }
.pd-value.paid   { color: var(--primary); background: var(--primary-light); padding: 2px 10px; border-radius: 50px; }
.pd-value.empty  { color: #C62828; background: #FFEBEE; padding: 2px 10px; border-radius: 50px; }

.pd-recharge-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.2s;
}
.pd-recharge-btn:hover { background: var(--primary-dark); }
.pd-logout-btn {
  width: 100%;
  background: none;
  color: var(--text-secondary);
  border: none;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  transition: color 0.2s, background 0.2s;
}
.pd-logout-btn:hover { background: #FFF3E8; color: var(--primary); }

/* ── CHAT LAYOUT ───────────────────────────────────────────── */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.messages-area {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-gray);
  padding: 28px 0 16px;
  scroll-behavior: smooth;
}
.messages-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── MESSAGES ──────────────────────────────────────────────── */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: fadeUp 0.25s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-row.user-row { justify-content: flex-end; }
.ai-av {
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 15px;
  font-weight: 900;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.bubble {
  max-width: 70%;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
}
.bubble-ai {
  background: white;
  color: var(--text-primary);
  border-radius: 20px 20px 20px 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.bubble-user {
  background: var(--primary);
  color: white;
  border-radius: 20px 20px 6px 20px;
}
.bubble-user strong, .bubble-user em { color: rgba(255,255,255,0.9); }
.bubble-error {
  background: #FFEBEE;
  color: #C62828;
  border-radius: 20px 20px 20px 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

/* Typing indicator bubble */
.typing-bubble {
  background: white;
  border-radius: 20px 20px 20px 6px;
  padding: 16px 20px;
  display: flex;
  gap: 5px;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.typing-bubble span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

/* ── INPUT BAR ─────────────────────────────────────────────── */
.input-bar {
  background: white;
  border-top: 1px solid var(--border);
  padding: 14px 20px 18px;
  flex-shrink: 0;
}
.input-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.msg-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 22px;
  padding: 13px 18px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  resize: none;
  outline: none;
  line-height: 1.55;
  min-height: 50px;
  max-height: 130px;
  overflow-y: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.msg-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255,107,0,0.10);
}
.msg-input::placeholder { color: var(--text-muted); }
.send-btn {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.send-btn:hover    { background: var(--primary-dark); transform: scale(1.06); }
.send-btn:disabled { background: var(--border); cursor: not-allowed; transform: none; }
.input-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── RECHARGE MODAL ────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: white;
  border-radius: 28px;
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22);
  animation: popIn 0.3s ease;
}
@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.modal-icon  { font-size: 52px; margin-bottom: 16px; }
.modal-title { font-size: 24px; font-weight: 900; margin-bottom: 10px; }
.modal-sub   { font-size: 15px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 28px; }
.recharge-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.recharge-opt {
  background: var(--bg-gray);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
}
.recharge-opt:hover { border-color: var(--primary); background: var(--primary-light); }
.r-price { font-size: 20px; font-weight: 900; color: var(--primary); }
.r-desc  { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.btn-dismiss {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  padding: 8px;
  transition: color 0.2s;
}
.btn-dismiss:hover { color: var(--text-primary); }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .auth-card       { padding: 32px 22px; }
  .bubble          { max-width: 88%; font-size: 14px; padding: 12px 16px; }
  .balance-pill    { display: none; }
  .btn-logout      { display: none; }
  .chat-nav-inner  { padding: 0 14px; }
}
