/* =====================================================
   EGWA — Account / Auth Page Styles
   ===================================================== */

/* ---- Shared Notice ---- */
.egwa-notice {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.egwa-notice-success { background: hsl(142,40%,93%); color: hsl(142,50%,28%); border: 1px solid hsl(142,40%,80%); }
.egwa-notice-error   { background: hsl(0,60%,95%);   color: hsl(0,60%,38%);   border: 1px solid hsl(0,60%,85%); }
.egwa-notice-info    { background: hsl(210,60%,95%);  color: hsl(210,60%,38%); border: 1px solid hsl(210,60%,85%); }

/* ---- Form Shared ---- */
.egwa-form { display: flex; flex-direction: column; gap: 1.25rem; }
.egwa-form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.egwa-form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.egwa-form-group input {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 1rem;
  background: var(--card);
  color: var(--foreground);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.egwa-form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsl(14 70% 61% / 0.15);
}
.egwa-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .egwa-form-row { grid-template-columns: 1fr; } }

/* Password field with toggle */
.egwa-pw-wrap { position: relative; display: flex; }
.egwa-pw-wrap input { padding-right: 3rem; }
.egwa-pw-toggle {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0.25rem;
  opacity: 0.6; transition: opacity 0.2s;
}
.egwa-pw-toggle:hover { opacity: 1; }

/* Password strength bar */
.egwa-pw-strength {
  height: 4px; background: var(--muted); border-radius: 99px;
  overflow: hidden; margin-top: 0.5rem;
}
.egwa-pw-strength-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: var(--primary); transition: width 0.3s, background 0.3s;
}
.egwa-pw-strength-fill.weak   { width: 33%; background: hsl(0,70%,55%); }
.egwa-pw-strength-fill.medium { width: 66%; background: hsl(38,90%,50%); }
.egwa-pw-strength-fill.strong { width: 100%; background: hsl(142,50%,45%); }

/* Checkbox */
.egwa-checkbox-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; cursor: pointer; user-select: none;
}
.egwa-checkbox-label input { width: auto; }

/* Buttons */
.egwa-btn-full { width: 100%; }
.egwa-btn-sm { padding: 0.4rem 1rem; font-size: 0.875rem; }
.egwa-btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.egwa-btn-outline:hover { background: var(--primary); color: var(--primary-foreground); }

/* Forgot link */
.egwa-forgot-link {
  color: var(--primary); font-weight: 500; font-size: 0.85rem;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}

/* =====================================================
   AUTH CARD (login/register)
   ===================================================== */
.egwa-auth-wrap {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.egwa-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 24px hsl(14 26% 19% / 0.07);
  overflow: hidden; /* prevent content from breaking card bounds */
}
@media (max-width: 480px) {
  .egwa-auth-card { padding: 2rem 1.25rem; border-radius: 1rem; }
  .egwa-auth-wrap { padding: 1.5rem 1rem; align-items: flex-start; padding-top: 2rem; }
}

/* Tab switcher */
.egwa-auth-tabs {
  display: flex;
  background: var(--muted);
  border-radius: 0.75rem;
  padding: 0.25rem;
  margin-bottom: 2rem;
}
.egwa-auth-tab {
  flex: 1; padding: 0.625rem 1rem;
  background: transparent; border: none; border-radius: 0.5rem;
  font-family: var(--font-main); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; color: var(--muted-foreground); transition: all 0.2s;
}
.egwa-auth-tab.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 4px hsl(14 26% 19% / 0.12);
}

/* Panels */
.egwa-auth-panel { display: none; }
.egwa-auth-panel.active { display: block; }
.egwa-auth-panel h2 { font-size: 1.5rem; margin-bottom: 0.375rem; }
.egwa-auth-subtitle { color: var(--muted-foreground); font-size: 0.9rem; margin-bottom: 1.75rem; }

/* Forgot password inline panel */
.egwa-forgot-panel { padding-top: 1.5rem; border-top: 1px solid var(--border); margin-top: 1.5rem; }
.egwa-forgot-panel-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.egwa-forgot-panel-btns .egwa-btn { flex: 1; min-width: 120px; }
.egwa-forgot-panel h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.egwa-forgot-panel p  { font-size: 0.9rem; color: var(--muted-foreground); margin-bottom: 1.25rem; }
.egwa-forgot-panel .egwa-form { overflow: visible; }
.egwa-forgot-panel [style*="display:flex"] {
  flex-wrap: wrap;
}
.hidden { display: none !important; }

/* =====================================================
   ACCOUNT DASHBOARD (logged in)
   ===================================================== */
.egwa-account-wrap {
  padding: 3rem 1.5rem;
  max-width: 860px;
  margin: 0 auto;
}

/* Header */
.egwa-account-header {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}
.egwa-account-avatar img {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid var(--primary);
}
.egwa-account-info h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.egwa-account-email { color: var(--muted-foreground); font-size: 0.9rem; margin-bottom: 0.75rem; }
@media (max-width: 480px) {
  .egwa-account-header { flex-direction: column; text-align: center; }
}

/* Tabs */
.egwa-account-tabs {
  display: flex; gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}
.egwa-tab-btn {
  padding: 0.625rem 1.25rem;
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; font-family: var(--font-main); font-size: 0.95rem;
  font-weight: 600; cursor: pointer; color: var(--muted-foreground);
  transition: color 0.2s, border-color 0.2s;
}
.egwa-tab-btn:hover  { color: var(--foreground); }
.egwa-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.egwa-tab-panel { display: none; }
.egwa-tab-panel.active { display: block; }

/* Orders */
.egwa-orders-list { display: flex; flex-direction: column; gap: 1rem; }
.egwa-order-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s;
}
.egwa-order-card:hover { box-shadow: 0 2px 12px hsl(14 26% 19% / 0.08); }
.egwa-order-meta {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 0.75rem;
}
.egwa-order-num   { font-weight: 700; font-size: 1rem; }
.egwa-order-date  { color: var(--muted-foreground); font-size: 0.85rem; }
.egwa-order-status {
  font-size: 0.8rem; font-weight: 600; padding: 0.2rem 0.75rem;
  border-radius: 99px; background: var(--muted);
}
.egwa-order-status.completed   { background: hsl(142,40%,90%); color: hsl(142,50%,28%); }
.egwa-order-status.processing  { background: hsl(210,60%,93%); color: hsl(210,60%,38%); }
.egwa-order-status.cancelled   { background: hsl(0,60%,95%);   color: hsl(0,60%,38%); }
.egwa-order-items { font-size: 0.9rem; color: var(--muted-foreground); margin-bottom: 0.75rem; }
.egwa-order-item-name + .egwa-order-item-name::before { content: ' · '; }
.egwa-order-footer { display: flex; justify-content: space-between; align-items: center; }
.egwa-order-total  { font-weight: 700; font-size: 1.05rem; color: var(--primary); }

/* Empty state */
.egwa-empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--muted-foreground);
}
.egwa-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.egwa-empty-state p { margin-bottom: 1.5rem; font-size: 1.05rem; }

/* Profile / Password forms */
.egwa-account-wrap .egwa-form {
  max-width: 520px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
}

/* 单品页 未登录提示 */
.egwa-login-to-buy {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--muted);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.egwa-login-to-buy p {
  margin-bottom: 1rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

.egwa-form .egwa-notice {
  margin-bottom: 0;
  margin-top: -0.25rem;  /* 稍微往上收一点，抵消 gap 视觉上的偏大感 */
}

/* ── Delete Account zone ── */
.egwa-delete-zone {
  max-width: 520px;
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--border);
  border-top: 3px solid hsl(14, 70%, 61%);
  border-radius: var(--radius);
  background: var(--card);
}
.egwa-delete-zone h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: 0.01em;
}
.egwa-delete-zone p {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.65;
}
.egwa-btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(0, 55%, 40%);
  background: transparent;
  border: 1.5px solid hsl(0, 60%, 72%);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.egwa-btn-danger:hover {
  background: hsl(0, 65%, 52%);
  color: #fff;
  border-color: hsl(0, 65%, 52%);
}

/* ── Delete confirmation modal ── */
.egwa-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61, 32, 22, 0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.egwa-modal-backdrop.hidden { display: none; }
.egwa-modal {
  background: var(--card);
  border-radius: 1rem;
  padding: 2.5rem 2rem 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(61, 32, 22, 0.18);
  animation: egwa-modal-in 0.2s ease;
}
@keyframes egwa-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.egwa-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}
.egwa-modal h3 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--foreground);
}
.egwa-modal p {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted-foreground);
}
.egwa-modal-warning {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: hsl(0, 55%, 38%);
  background: hsl(0, 60%, 97%);
  border: 1px solid hsl(0, 60%, 86%);
  border-radius: calc(var(--radius) * 0.75);
}
.egwa-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.75rem;
}
.egwa-modal-actions form { margin: 0; }
.egwa-modal-actions .egwa-btn-danger-confirm {
  display: block;
  width: 100%;
  padding: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: hsl(0, 62%, 50%);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.egwa-modal-actions .egwa-btn-danger-confirm:hover {
  background: hsl(0, 62%, 42%);
}
.egwa-modal-actions .egwa-btn-cancel {
  display: block;
  width: 100%;
  padding: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.egwa-modal-actions .egwa-btn-cancel:hover {
  background: var(--border);
}