/* ===== Account / Profile page ===== */

/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.acct-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--cream-edge);
  border-top-color: var(--coral);
  animation: spin .75s linear infinite;
  flex-shrink: 0;
}

/* ── Auth Page ──────────────────────────────────── */
.acct-auth-page {
  min-height: 100vh;
  background: var(--sky-top);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.acct-auth-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 130% 80% at 15% -5%, #ffd0e0 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 90% 110%, #ffc0d5 0%, transparent 50%);
}
.acct-auth-nav {
  position: relative; z-index: 2;
  padding: 20px 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.acct-auth-nav .talio-mark img { height: 60px; }
.acct-auth-nav-back {
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  text-decoration: none; opacity: .7;
  transition: opacity .15s;
}
.acct-auth-nav-back:hover { opacity: 1; }

.acct-auth-wrap {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px 48px;
}
.acct-auth-card {
  background: white;
  border-radius: 28px;
  padding: 36px 36px 32px;
  box-shadow: 0 24px 64px -20px rgba(60,30,50,.22), 0 4px 16px rgba(60,30,50,.08);
  width: 100%; max-width: 420px;
  border: 2px solid rgba(58,37,64,.05);
}
.acct-auth-title {
  font-family: var(--serif); font-weight: 800;
  font-size: 28px; color: var(--ink);
  margin-bottom: 6px; letter-spacing: -.02em;
}
.acct-auth-sub {
  font-size: 14px; color: var(--ink-3); font-weight: 500;
  margin-bottom: 24px; line-height: 1.5;
}

.acct-google-btn {
  width: 100%; padding: 13px;
  border-radius: 14px;
  border: 2px solid rgba(58,37,64,.1);
  background: white;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 15px; color: var(--ink);
  box-shadow: 0 2px 8px -2px rgba(60,30,50,.08);
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
}
.acct-google-btn:hover { border-color: rgba(58,37,64,.2); box-shadow: 0 4px 14px -4px rgba(60,30,50,.14); }
.acct-google-btn:disabled { opacity: .55; cursor: not-allowed; }

.acct-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--ink-mute); font-size: 12px; font-weight: 600;
}
.acct-divider::before, .acct-divider::after {
  content: ""; flex: 1; height: 1px; background: rgba(58,37,64,.1);
}

.acct-error {
  background: #fff0f3; border: 1.5px solid #ffd0da;
  border-radius: 10px; padding: 10px 14px;
  font-size: 13px; color: #c0304e; font-weight: 600;
  margin-bottom: 14px;
}
.acct-success {
  background: #f0fdf4; border: 1.5px solid #bbf7d0;
  border-radius: 10px; padding: 10px 14px;
  font-size: 13px; color: #16a34a; font-weight: 600;
  margin-bottom: 14px;
}

.acct-field { margin-bottom: 14px; }
.acct-field label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.acct-field input, .acct-settings input[type="text"],
.acct-settings input[type="email"], .acct-settings input[type="password"] {
  width: 100%; padding: 11px 14px;
  border: 2px solid rgba(58,37,64,.1); border-radius: 12px;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--cream); outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.acct-field input:focus, .acct-settings input:focus { border-color: var(--coral); }
.acct-field input:disabled, .acct-settings input:disabled { opacity: .55; cursor: not-allowed; }

.acct-submit-btn {
  width: 100%; padding: 14px;
  border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--coral) 0%, var(--coral-dk) 100%);
  color: white; font-family: var(--sans); font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 0 rgba(160,30,70,.22), 0 8px 20px -8px rgba(255,95,136,.55);
  transition: transform .12s, box-shadow .12s;
  margin-top: 4px;
}
.acct-submit-btn:hover { transform: translateY(-1px); }
.acct-submit-btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(160,30,70,.22); }
.acct-submit-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.acct-mode-toggle {
  margin-top: 18px; text-align: center;
  font-size: 13px; color: var(--ink-3); font-weight: 500;
}
.acct-mode-toggle button {
  color: var(--coral-dk); font-weight: 700; font-size: 13px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--sans);
}
.acct-mode-toggle button:hover { text-decoration: underline; }

/* ── Profile Page ────────────────────────────────── */
.acct-profile-page { min-height: 100vh; background: var(--cream); }

.acct-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,246,238,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid rgba(58,37,64,.07);
  padding: 12px 40px;
  display: flex; align-items: center; gap: 12px;
}
.acct-nav .talio-mark img { height: 56px; }
.acct-nav-link {
  font-size: 13px; font-weight: 700; color: var(--ink-3);
  text-decoration: none; padding: 7px 12px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.acct-nav-link:hover { background: rgba(58,37,64,.06); color: var(--ink); }
.acct-nav-btn {
  padding: 8px 16px; border-radius: 999px;
  border: 2px solid rgba(58,37,64,.12);
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  color: var(--ink-2); background: white; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.acct-nav-btn:hover { border-color: var(--coral); color: var(--coral-dk); }

/* Profile hero */
.acct-profile-hero {
  background: linear-gradient(135deg, #ff8fab 0%, var(--violet-dk) 100%);
  padding: 48px 40px 56px;
}
.acct-profile-hero-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
}
.acct-avatar-lg {
  width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 800; font-size: 34px;
  color: white;
  box-shadow: 0 0 0 4px rgba(255,255,255,.3), 0 10px 30px -10px rgba(40,20,40,.4);
}
.acct-profile-info { color: white; }
.acct-profile-name {
  font-family: var(--serif); font-weight: 800; font-size: 28px;
  letter-spacing: -.02em; margin-bottom: 4px;
}
.acct-profile-email { font-size: 14px; opacity: .75; font-weight: 500; margin-bottom: 10px; }
.acct-profile-plan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acct-plan-pill {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.35);
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: white;
}
.acct-profile-stories { font-size: 13px; opacity: .7; font-weight: 600; }

/* Tabs bar */
.acct-tabs-bar {
  background: white;
  border-bottom: 2px solid rgba(58,37,64,.07);
  position: sticky; top: 80px; z-index: 40;
}
.acct-tabs-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; gap: 0; padding: 0 40px;
}
.acct-tab {
  padding: 16px 20px; font-size: 14px; font-weight: 700;
  color: var(--ink-3); background: none; border: none;
  cursor: pointer; font-family: var(--sans);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.acct-tab:hover { color: var(--ink); }
.acct-tab.active { color: var(--coral-dk); border-bottom-color: var(--coral); }

/* Content area */
.acct-content {
  max-width: 900px; margin: 0 auto;
  padding: 32px 40px 64px;
}

/* ── Stories ──────────────────────────────────────── */
.acct-search-wrap { margin-bottom: 20px; }
.acct-search {
  width: 100%; max-width: 360px;
  padding: 11px 18px; border-radius: 999px;
  border: 2px solid rgba(58,37,64,.1); background: white;
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  outline: none; transition: border-color .15s;
  box-sizing: border-box;
}
.acct-search:focus { border-color: var(--coral); }

.acct-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 20px; text-align: center; gap: 8px;
}
.acct-empty-icon { font-size: 48px; margin-bottom: 8px; }
.acct-empty-title { font-family: var(--serif); font-weight: 800; font-size: 22px; color: var(--ink); }
.acct-empty-sub { font-size: 14px; color: var(--ink-3); font-weight: 500; max-width: 300px; line-height: 1.5; }

.acct-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.acct-story-card {
  background: white; border-radius: 18px; overflow: hidden;
  box-shadow: 0 4px 18px -4px rgba(60,30,50,.10), 0 2px 6px rgba(60,30,50,.06);
  border: 2px solid rgba(58,37,64,.04);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.acct-story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -8px rgba(60,30,50,.18), 0 4px 10px rgba(60,30,50,.08);
}
.acct-story-illus {
  aspect-ratio: 16/9; position: relative; overflow: hidden;
  display: grid; place-items: center; font-size: 36px;
}
.acct-story-illus img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.acct-story-info { padding: 14px 16px 10px; flex: 1; }
.acct-story-title {
  font-family: var(--serif); font-weight: 700; font-size: 15px;
  color: var(--ink); line-height: 1.3; margin-bottom: 6px;
}
.acct-story-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.acct-story-meta span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.acct-story-tag {
  background: var(--cream); border: 1.5px solid rgba(58,37,64,.1);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--ink-2);
}
.acct-story-date { font-size: 11px; color: var(--ink-mute); font-weight: 500; }
.acct-story-read {
  padding: 10px 16px; border-top: 1.5px solid rgba(58,37,64,.06);
  font-size: 13px; font-weight: 700; color: var(--coral-dk);
}

/* ── Story Modal ──────────────────────────────────── */
.acct-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,10,30,.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.acct-modal {
  background: white; border-radius: 24px; overflow: hidden;
  width: 100%; max-width: 560px;
  box-shadow: 0 40px 100px -20px rgba(20,10,30,.55);
  position: relative;
  animation: slideUp .25s cubic-bezier(.22,1,.36,1);
  max-height: 92vh; display: flex; flex-direction: column;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(24px) } to { opacity: 1; transform: none } }
.acct-modal-header { flex-shrink: 0; position: relative; }
.acct-modal-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: none; cursor: pointer;
  font-size: 22px; font-weight: 800; color: var(--ink);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px -2px rgba(40,20,40,.25);
  transition: background .15s;
  z-index: 2;
}
.acct-modal-nav:hover { background: white; }
.acct-modal-nav.prev { left: 12px; }
.acct-modal-nav.next { right: 12px; }
.acct-modal-pg {
  position: absolute; bottom: 10px; right: 14px;
  background: rgba(0,0,0,.45); color: white;
  font-size: 11px; font-weight: 700; border-radius: 999px;
  padding: 3px 10px;
}
.acct-modal-body { padding: 24px 28px; overflow-y: auto; }
.acct-modal-title {
  font-family: var(--serif); font-weight: 800; font-size: 22px;
  color: var(--ink); margin-bottom: 12px; line-height: 1.25;
}
.acct-modal-text {
  font-family: var(--serif); font-size: 17px; font-weight: 500;
  color: var(--ink-2); line-height: 1.75;
}
.acct-modal-dots {
  display: flex; gap: 6px; justify-content: center; margin-top: 18px;
}
.acct-dot {
  width: 8px; height: 8px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: rgba(58,37,64,.18); transition: background .15s, width .15s;
}
.acct-dot.on { background: var(--coral); width: 20px; border-radius: 999px; }
.acct-modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.35); border: none; cursor: pointer;
  color: white; font-size: 14px; font-weight: 700;
  display: grid; place-items: center; z-index: 5;
  transition: background .15s;
}
.acct-modal-close:hover { background: rgba(0,0,0,.55); }

/* ── Settings ─────────────────────────────────────── */
.acct-settings { display: flex; flex-direction: column; gap: 0; }
.acct-settings-section {
  padding: 28px 0;
  border-bottom: 1.5px solid rgba(58,37,64,.07);
}
.acct-settings-section:last-child { border-bottom: none; }
.acct-settings-section h3 {
  font-size: 15px; font-weight: 800; color: var(--ink);
  margin-bottom: 14px;
}
.acct-settings-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.acct-settings-row input { flex: 1; min-width: 200px; }
.acct-provider-badge {
  font-size: 12px; font-weight: 700; color: var(--ink-3);
  background: var(--cream); border: 1.5px solid rgba(58,37,64,.1);
  padding: 6px 12px; border-radius: 999px;
  white-space: nowrap;
}

/* Shared button */
.acct-btn {
  padding: 10px 20px; border-radius: 12px; border: 2px solid rgba(58,37,64,.12);
  font-family: var(--sans); font-size: 14px; font-weight: 700;
  color: var(--ink-2); background: white; cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}
.acct-btn:hover { border-color: rgba(58,37,64,.25); }
.acct-btn.primary {
  background: linear-gradient(180deg, var(--coral) 0%, var(--coral-dk) 100%);
  border-color: transparent; color: white;
  box-shadow: 0 3px 0 rgba(160,30,70,.2), 0 6px 16px -6px rgba(255,95,136,.45);
}
.acct-btn.primary:hover { transform: translateY(-1px); }
.acct-btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ── Subscription ─────────────────────────────────── */
.acct-plan-status {
  background: linear-gradient(135deg, var(--cream), white);
  border: 2px solid rgba(58,37,64,.07);
  border-radius: 20px; padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 32px;
}
.acct-plan-label { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.acct-plan-name {
  font-family: var(--serif); font-weight: 800; font-size: 26px; color: var(--ink);
}
.acct-plan-credits { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-top: 4px; }
.acct-credit-ring { position: relative; flex-shrink: 0; }
.acct-credit-ring-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: var(--coral-dk);
}

.acct-plan-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.acct-plan-card {
  background: white; border: 2px solid rgba(58,37,64,.08);
  border-radius: 20px; padding: 22px 20px;
  position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.acct-plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.acct-plan-card.featured {
  border-color: var(--coral); background: #fff6f9;
  box-shadow: 0 6px 24px -8px rgba(255,95,136,.25);
}
.acct-plan-badge {
  position: absolute; top: -1px; right: 16px;
  background: linear-gradient(135deg, var(--coral), var(--coral-dk));
  color: white; font-size: 10px; font-weight: 800; padding: 4px 10px;
  border-radius: 0 0 10px 10px; letter-spacing: .04em; text-transform: uppercase;
}
.acct-plan-price {
  font-family: var(--serif); font-weight: 800; font-size: 30px; color: var(--ink);
  margin-bottom: 2px; letter-spacing: -.02em;
}
.acct-plan-price span { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.acct-plan-title { font-weight: 800; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.acct-plan-desc { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-bottom: 16px; line-height: 1.4; }

/* ── Nav account button (landing page, logged in) ─── */
.v3-nav-account {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  text-decoration: none;
  box-shadow: 0 4px 14px -4px rgba(58,37,64,.35);
  transition: transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.v3-nav-account:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(58,37,64,.45); }
.v3-nav-account-dot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 800; font-size: 13px; color: white;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 680px) {
  .acct-auth-card { padding: 28px 22px; }
  .acct-auth-nav { padding: 16px 20px; }
  .acct-nav { padding: 10px 20px; }
  .acct-profile-hero { padding: 32px 20px 40px; }
  .acct-profile-hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .acct-tabs-inner { padding: 0 16px; }
  .acct-content { padding: 24px 20px 48px; }
  .acct-plan-status { flex-direction: column; align-items: flex-start; }
  .acct-stories-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 420px) {
  .acct-stories-grid { grid-template-columns: 1fr; }
}
