/* ==== auth.css — sign up / login / forgot-password overlay ==== */

/* ---- Auth overlay: sign up / login / forgot-password screens ---- */
.auth-overlay{
  position:fixed;inset:0;background:var(--parchment);z-index:80;display:none;
  overflow-y:auto;
}
.auth-overlay.open{display:block;}
.auth-topbar{
  display:flex;align-items:center;gap:14px;padding:16px;background:var(--teal);color:var(--sage);
  font-family:'Noto Serif Bengali',serif;font-weight:700;font-size:16px;position:sticky;top:0;z-index:1;
}
.auth-back{background:none;border:none;color:var(--sage);font-size:18px;cursor:pointer;padding:4px;}
.auth-body{max-width:420px;margin:0 auto;padding:30px 22px 60px;}
.auth-title{font-family:'Noto Serif Bengali',serif;font-size:20px;margin:0 0 8px;text-align:center;}
.auth-sub{font-size:13.5px;color:var(--ink-soft);text-align:center;line-height:1.6;margin:0 0 22px;}
.auth-field{
  width:100%;border-radius:12px;border:1px solid var(--line);background:var(--panel);
  color:var(--ink);font-family:'Hind Siliguri',sans-serif;font-size:14.5px;padding:13px 15px;
  outline:none;margin-bottom:12px;
}
.auth-field:focus{border-color:var(--gold);}
/* ---- Social sign-in row (Google/Facebook/X/GitHub/Microsoft) — একই রো
   চয়েস/সাইন-আপ/লগইন তিন স্ক্রিনেই ব্যবহৃত হয় (js/auth.js socialAuthButtonsHtml) ---- */
.auth-social-divider{
  display:flex;align-items:center;gap:10px;margin:18px 0 14px;color:var(--ink-soft);
  font-family:'Hind Siliguri',sans-serif;font-size:12px;
}
.auth-social-divider::before,.auth-social-divider::after{content:'';flex:1;height:1px;background:var(--line);}
.auth-social-row{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin-bottom:4px;}
.auth-social-btn{
  width:48px;height:48px;border-radius:50%;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;font-size:18px;
  border:1px solid var(--line);background:var(--parchment);color:var(--brand-color);cursor:pointer;
  transition:transform .12s ease,border-color .15s ease,box-shadow .15s ease;
}
.auth-social-btn:hover{border-color:color-mix(in srgb, var(--brand-color) 55%, var(--line));box-shadow:0 4px 14px color-mix(in srgb, var(--brand-color) 20%, transparent);}
.auth-social-btn:active{transform:scale(.92);}
.auth-social-btn.is-busy,.auth-social-btn:disabled{opacity:.5;pointer-events:none;}
.auth-switch{text-align:center;font-size:13px;color:var(--ink-soft);margin-top:16px;}
.auth-switch a{color:var(--gold);font-weight:700;text-decoration:none;}
.auth-error{color:#C0392B;font-size:12.5px;margin:-4px 0 10px;min-height:1px;}

/* ---- Submit button with a trailing icon-in-circle (matches "সাইন আপ ⊕" style) ---- */
.auth-cta-btn.has-icon{display:flex;align-items:center;justify-content:center;gap:10px;}
.auth-cta-btn.has-icon .cta-icon-dot{
  width:22px;height:22px;border-radius:50%;border:1.5px solid currentColor;
  display:flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0;
}

/* =========================================================
   Illustration scenes — one per auth screen. Built from CSS
   shapes + a Font Awesome glyph rather than imported artwork,
   so every theme (see css/base.css, 7 themes) recolors them
   automatically via the shared --teal/--gold/--sage tokens.
   ========================================================= */
.auth-scene{position:relative;width:168px;height:168px;margin:4px auto 22px;}

/* soft glow behind every scene */
.auth-scene::before{
  content:'';position:absolute;inset:10px;border-radius:50%;
  background:radial-gradient(circle, var(--gold-soft) 0%, transparent 70%);
  opacity:.6;
}

/* floating sparkle/dot accents, reused across scenes at different spots */
.auth-spark{position:absolute;color:var(--gold);opacity:.85;}
.auth-spark.s1{top:2px;right:18px;font-size:15px;}
.auth-spark.s2{bottom:14px;left:4px;font-size:11px;}
.auth-spark.s3{top:38px;left:-6px;font-size:9px;}
.auth-dot{position:absolute;width:7px;height:7px;border-radius:50%;background:var(--gold);opacity:.7;}

/* ---- Scene: choice screen — book + achievement medal ---- */
.auth-scene-choice .auth-icon-box{
  position:absolute;inset:24px;border-radius:26px;background:var(--teal);color:var(--gold-soft);
  display:flex;align-items:center;justify-content:center;font-size:44px;
  box-shadow:0 14px 30px -12px rgba(0,0,0,.35);
}
.auth-scene-choice .auth-medal{
  position:absolute;bottom:20px;right:14px;width:44px;height:44px;border-radius:50%;background:var(--gold);
  color:var(--teal-deep);display:flex;align-items:center;justify-content:center;font-size:18px;
  border:3px solid var(--parchment);box-shadow:0 6px 14px -4px rgba(0,0,0,.3);
}

/* ---- Scene: signup screen — profile card + "add info" mock ---- */
.auth-scene-signup{display:flex;align-items:center;justify-content:center;gap:14px;width:auto;height:auto;margin:6px auto 24px;}
.auth-scene-signup::before{display:none;}
.auth-card-tile{
  position:relative;width:96px;height:120px;border-radius:18px;background:var(--teal);
  transform:rotate(-6deg);box-shadow:0 12px 26px -10px rgba(0,0,0,.35);overflow:hidden;flex-shrink:0;
}
.auth-card-tile::before{ /* 8-point geometric star motif, echoing Islamic pattern work */
  content:'';position:absolute;left:50%;top:50%;width:46px;height:46px;
  background:var(--gold-soft);opacity:.85;
  clip-path:polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  transform:translate(-50%,-50%) rotate(8deg);
}
.auth-plus-mock{display:flex;flex-direction:column;align-items:flex-start;gap:10px;}
.auth-plus-circle{
  width:38px;height:38px;border-radius:50%;border:2px solid var(--gold);color:var(--gold);
  display:flex;align-items:center;justify-content:center;font-size:15px;
}
.auth-plus-row{display:flex;align-items:center;gap:8px;}
.auth-plus-row .dot{width:10px;height:10px;border-radius:50%;background:var(--sage);border:1px solid var(--line);flex-shrink:0;}
.auth-plus-row .bar{width:64px;height:8px;border-radius:5px;background:var(--sage);}
.auth-plus-row .bar.short{width:44px;}

/* ---- Scene: login screen — key/unlock + leaf accents ---- */
.auth-scene-login .auth-icon-box{
  position:absolute;inset:26px;border-radius:50%;background:var(--panel);border:1.5px solid var(--line);
  color:var(--teal);display:flex;align-items:center;justify-content:center;font-size:40px;
}
.auth-leaf{
  position:absolute;width:26px;height:26px;background:var(--sage);
  border-radius:0 60% 0 60%;
}
.auth-leaf.l1{bottom:6px;left:2px;transform:rotate(15deg);}
.auth-leaf.l2{bottom:-2px;right:10px;width:18px;height:18px;transform:rotate(-20deg);}

@media (max-width:480px){
  .app-shell{padding-left:12px;padding-right:12px;}
  .bn-item span{font-size:9.5px;}
  .stats-big{font-size:20px;}
}

/* ---- Profile modal (js/auth.js openProfileModal) — view + manage account ---- */
.profile-modal-box{max-width:420px;}
.profile-avatar-row{display:flex;flex-direction:column;align-items:center;gap:14px;margin-bottom:20px;}
.profile-avatar-lg{
  width:76px;height:76px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  color:#fff;font-family:'Noto Serif Bengali',serif;font-weight:700;font-size:30px;
  box-shadow:0 8px 20px -8px rgba(0,0,0,.35);
}
.profile-color-swatches{display:flex;gap:9px;flex-wrap:wrap;justify-content:center;}
.profile-color-dot{
  width:24px;height:24px;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0;
}
.profile-color-dot.active{border-color:var(--ink);box-shadow:0 0 0 2px var(--parchment) inset;}
.profile-avatar-toggle{
  display:flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;
  background:none;border:none;padding:2px;margin:0 0 2px;font:inherit;
  font-size:12px;color:var(--ink-soft);font-weight:600;
}
.profile-avatar-toggle-icon{font-size:10px;transition:transform .2s ease;}
.profile-avatar-toggle.open .profile-avatar-toggle-icon{transform:rotate(180deg);}
.profile-avatar-grid{
  display:grid;grid-template-columns:repeat(7,1fr);gap:8px;justify-items:center;
  overflow:hidden;max-height:0;opacity:0;margin-top:0;margin-bottom:0;
  transition:max-height .25s ease, opacity .2s ease, margin-top .25s ease, margin-bottom .25s ease;
}
.profile-avatar-grid.open{max-height:240px;opacity:1;margin-top:10px;margin-bottom:4px;}
.profile-avatar-tile{
  width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-size:18px;line-height:1;cursor:pointer;border:2px solid transparent;padding:0;background:var(--panel);
}
.profile-avatar-tile.active{border-color:var(--ink);box-shadow:0 0 0 2px var(--parchment) inset;}
.profile-avatar-tile.none-tile{background:var(--panel);border:2px dashed var(--line);color:var(--ink-soft);font-size:11.5px;font-weight:700;}
.profile-avatar-tile.none-tile.active{border-style:solid;}
.profile-field-label{display:block;font-size:12px;color:var(--ink-soft);margin:0 2px 6px;font-weight:600;}
.profile-joined{font-size:12px;color:var(--ink-soft);margin:-4px 0 14px;display:flex;align-items:center;gap:6px;}
.profile-error{color:#C0392B;font-size:12.5px;margin:-4px 0 10px;min-height:1px;}
.profile-stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0 16px;}
.profile-stat-box{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:14px 6px 12px;text-align:center;}
.profile-stat-icon{
  width:30px;height:30px;border-radius:50%;background:var(--gold-soft);color:var(--gold);
  display:flex;align-items:center;justify-content:center;font-size:13px;margin:0 auto 8px;
}
.profile-stat-val{font-family:'Noto Serif Bengali',serif;font-weight:700;font-size:16px;}
.profile-stat-lbl{font-size:11px;color:var(--ink-soft);margin-top:2px;}
.profile-meta-box{
  background:var(--panel);border:1px solid var(--line);border-radius:12px;
  padding:10px 12px;margin:0 0 16px;display:flex;flex-direction:column;gap:10px;
}
.profile-meta-row{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.profile-meta-text{display:flex;flex-direction:column;gap:2px;min-width:0;}
.profile-meta-label{font-size:11px;color:var(--ink-soft);font-weight:600;}
.profile-meta-value{
  font-size:12.5px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;font-family:monospace;
}
.profile-copy-btn{background:none;border:none;color:var(--ink-soft);cursor:pointer;padding:6px;font-size:13px;flex-shrink:0;}
.profile-copy-btn:active{color:var(--teal);}
.profile-linked-badge{
  display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--ink-soft);
  padding:9px 12px;background:var(--panel);border:1px solid var(--line);border-radius:10px;
}
.profile-actions{display:flex;flex-direction:column;gap:8px;}
.profile-action-btn{justify-content:flex-start;width:100%;box-sizing:border-box;}
.profile-action-danger{color:#C0392B;border-color:rgba(192,57,43,.35);}
.profile-action-danger i{color:#C0392B;}
.profile-danger-zone{
  margin-top:18px;padding:14px;border:1.5px dashed rgba(192,57,43,.4);border-radius:12px;background:rgba(192,57,43,.05);
}
.profile-danger-zone-title{color:#C0392B;font-size:12.5px;font-weight:700;letter-spacing:.3px;display:flex;align-items:center;gap:6px;margin-bottom:6px;}
.profile-danger-zone-desc{margin:0 0 12px;color:var(--ink-soft);font-size:12px;line-height:1.6;}
.profile-delete-confirm-btn{background:#C0392B !important;border-color:#C0392B !important;}

/* ==== Profile modal v2 — hero header, view/edit modes, completeness,
   badge showcase, mini heatmap, micro-interactions ==== */

/* No app-modal-head bar on this one — the hero cover replaces it, so the
   close button floats over the cover instead. */
.profile-modal-v2{position:relative;}
.profile-modal-v2 .app-modal-body{padding-top:0;}
.profile-modal-close-abs{
  position:absolute;top:10px;right:10px;z-index:5;width:32px;height:32px;border-radius:50%;
  background:rgba(10,20,17,.32);color:#fff;border:none;display:flex;align-items:center;justify-content:center;
  font-size:14px;cursor:pointer;backdrop-filter:blur(2px);
}
.profile-modal-close-abs:active{background:rgba(10,20,17,.5);}

/* ---- Hero: gradient cover bleeding to the modal edges + overlapping avatar ---- */
.profile-hero{position:relative;text-align:center;margin:0 -18px 4px;padding:0 18px;}
.profile-hero-cover{
  height:78px;margin:0 -18px;
  background:
    radial-gradient(circle at 14% 22%, rgba(255,255,255,.14) 0, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 84% 78%, rgba(255,255,255,.10) 0, rgba(255,255,255,0) 46%),
    linear-gradient(135deg,var(--teal) 0%,var(--teal-deep) 62%,var(--gold) 150%);
  border-radius:var(--modal-radius,var(--radius)) var(--modal-radius,var(--radius)) 0 0;
}
.profile-hero-avatar-wrap{display:flex;justify-content:center;margin-top:-40px;position:relative;z-index:2;}
.profile-hero-avatar{
  width:88px;height:88px;font-size:32px;
  box-shadow:0 0 0 4px var(--parchment),0 8px 20px -8px rgba(0,0,0,.35);
  transition:transform .15s ease;
}
.avatar-pop{animation:avatarPop .35s cubic-bezier(.34,1.56,.64,1);}
@keyframes avatarPop{0%{transform:scale(1);}45%{transform:scale(1.15);}100%{transform:scale(1);}}
.profile-hero-name{font-family:'Noto Serif Bengali',serif;font-weight:700;font-size:19px;color:var(--ink);margin-top:10px;}
.profile-hero-position{font-size:12.5px;color:var(--ink-soft);margin-top:2px;}
.profile-hero .profile-joined{justify-content:center;margin-top:8px;}

/* One-tap photo upload: small camera badge sitting on the hero avatar's
   edge, same footprint everywhere the app uses a floating icon button. */
.profile-hero-camera-badge{
  position:absolute;left:50%;bottom:-2px;transform:translateX(26px);z-index:3;
  width:30px;height:30px;border-radius:50%;background:var(--gold);color:var(--teal-deep);
  border:3px solid var(--parchment);display:flex;align-items:center;justify-content:center;
  font-size:12px;cursor:pointer;padding:0;
}
.profile-hero-camera-badge:active{background:var(--gold-soft);}

/* Avatar-grid photo tile: same 38px circle as the icon tiles, dashed like
   the "initial" tile but with a camera glyph + its own loading state. */
.profile-avatar-photo-tile{
  background:var(--panel);border:2px dashed var(--gold);color:var(--gold);
  display:flex;align-items:center;justify-content:center;
  background-size:cover;background-position:center;
}
.profile-avatar-photo-tile i{transition:opacity .15s ease;}
.profile-avatar-photo-tile.has-photo i{opacity:0;}
.profile-avatar-photo-tile.active{border-style:solid;background-color:var(--gold);color:var(--teal-deep);}
.profile-avatar-photo-tile.loading{opacity:.5;pointer-events:none;}
.profile-photo-remove-row{display:flex;justify-content:center;margin:-2px 0 12px;}
.profile-photo-remove-row button{
  background:none;border:none;color:#C0392B;font-size:12px;font-weight:600;
  display:flex;align-items:center;gap:6px;cursor:pointer;padding:6px 8px;
}

/* ---- Profile completeness bar (reuses .badges-summary-bar/-fill for the
   animated fill + gradient look already defined for the badges progress) ---- */
.profile-completion-row{margin:16px 2px 14px;}
.profile-completion-label{display:flex;justify-content:space-between;font-size:12px;color:var(--ink-soft);margin-bottom:6px;}
.profile-completion-label span:last-child{font-weight:700;color:var(--ink);font-family:'Noto Serif Bengali',serif;}

/* ---- View mode: bio + info chips ---- */
.profile-view-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;margin-bottom:14px;}
.profile-bio-text{margin:0 0 10px;font-size:13.5px;line-height:1.7;color:var(--ink);}
.profile-bio-text:last-child{margin-bottom:0;}
.profile-chip-row{display:flex;flex-wrap:wrap;gap:8px;}
.profile-chip{display:flex;align-items:center;gap:6px;background:var(--parchment);border:1px solid var(--line);border-radius:999px;padding:6px 12px;font-size:12px;color:var(--ink-soft);}
.profile-chip i{color:var(--gold);font-size:11px;}
.profile-empty-hint{margin:0;font-size:12.5px;color:var(--ink-soft);line-height:1.6;text-align:center;padding:4px 2px;}

.profile-edit-toggle-btn{width:100%;justify-content:center;margin-bottom:16px;box-sizing:border-box;}

/* ---- Edit mode form ---- */
.profile-edit-form{margin-bottom:16px;}
.profile-edit-btn-row{display:flex;gap:10px;margin-top:4px;}
.profile-edit-btn-row .settings-btn{width:auto;flex:0 0 auto;justify-content:center;padding:0 18px;}
.profile-save-btn{flex:1;margin:0;display:flex;align-items:center;justify-content:center;gap:8px;transition:background .25s ease;}
.profile-save-success{background:var(--gold) !important;color:var(--teal-deep) !important;}

/* ---- Badge showcase link (also styles the equivalent "See all" link on
   the stats page, which previously had no color of its own) ---- */
.badges-head a{color:var(--teal);font-size:12.5px;font-weight:600;text-decoration:none;}
body.theme-dark-accent .badges-head a{color:var(--gold);}
.badges-head a:active{opacity:.7;}

.profile-mini-heatmap{margin-bottom:4px;}

@media (max-width:380px){
  .profile-hero-avatar{width:74px;height:74px;font-size:28px;}
  .profile-hero-name{font-size:17px;}
}

/* ---- সংযুক্ত অ্যাকাউন্ট: প্রোফাইলে শুধু একটা "একাউন্ট লিংক করুন" সামারি
   বাটন — ট্যাপ করলে আলাদা মডালে পূর্ণ প্ল্যাটফর্ম লিস্ট খোলে ---- */
.profile-link-account-btn{
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 9%, var(--panel)), var(--panel));
  padding: 12px 14px; margin: 0 0 18px; cursor: pointer; text-align: left;
  transition: border-color .15s ease, transform .12s ease;
}
.profile-link-account-btn:active{ transform: scale(.985); }
body.theme-dark-accent .profile-link-account-btn{
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--panel)), var(--panel));
}
.profile-link-account-icon{
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal);
}
body.theme-dark-accent .profile-link-account-icon{ background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.profile-link-account-text{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-link-account-title{ font-size: 13.5px; font-weight: 700; color: var(--ink); }
.profile-link-account-sub{ font-size: 11.5px; color: var(--ink-soft); }
.profile-link-account-chevron{ color: var(--ink-soft); font-size: 13px; flex-shrink: 0; }

/* ---- "একাউন্ত লিংক করুন" মডাল: Google/Facebook/X/GitHub/Microsoft-এর
   আধুনিক লিস্ট, প্রতিটা রো-তে আইকন + স্ট্যাটাস + অ্যাকশন পিল ---- */
.link-accounts-modal-box{ max-width: 420px; }
.link-accounts-hint{ margin: 0 0 14px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.link-account-list{ display: flex; flex-direction: column; gap: 8px; }
.link-account-row{
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 11px 12px; transition: border-color .15s ease;
}
.link-account-row.is-linked{ border-color: color-mix(in srgb, var(--brand-color) 45%, var(--line)); }
.link-account-icon{
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--brand-color) 15%, transparent);
  color: var(--brand-color); font-size: 16px;
}
.link-account-info{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link-account-name{ font-size: 13.5px; font-weight: 700; color: var(--ink); }
.link-account-state{ font-size: 11px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; }
.link-account-row.is-linked .link-account-state{ color: var(--brand-color); font-weight: 600; }
.link-account-row.is-linked .link-account-state i{ font-size: 10px; }
.link-account-action{
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 11.5px; font-weight: 700; padding: 7px 12px; border-radius: 20px;
  border: 1px solid var(--line); background: none; color: var(--ink-soft); cursor: pointer;
  transition: opacity .12s ease, transform .12s ease;
}
.link-account-action i{ font-size: 10px; }
.link-account-action-link{ color: var(--brand-color); border-color: color-mix(in srgb, var(--brand-color) 45%, var(--line)); }
.link-account-action-unlink{ color: var(--danger, #c0392b); border-color: color-mix(in srgb, var(--danger, #c0392b) 35%, var(--line)); }
.link-account-action:active{ transform: scale(.94); }
.link-account-action:disabled, .link-account-action.is-busy{ opacity: .55; pointer-events: none; }
.link-account-locked{ color: var(--ink-soft); font-size: 13px; flex-shrink: 0; padding: 0 6px; }

@media (max-width: 380px){
  .link-account-name{ font-size: 12.5px; }
  .link-account-action span{ display: none; }
  .link-account-action{ padding: 8px; }
  .link-account-action i{ font-size: 12px; }
}
