/* =========================================================
   My Opinion Panel — Components (components.css)
   Buttons, cards, forms, badges, accordion, filters,
   dashboard, popup, tables
   ========================================================= */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-head); font-weight: 700; font-size: .97rem;
  padding: 13px 22px; border-radius: 999px; cursor: pointer; border: 1.5px solid transparent;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap; line-height: 1;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-600); color:#fff; transform: translateY(-2px); box-shadow: 0 18px 40px rgba(5,150,105,.34); }

.btn-gold { background: var(--gold); color: #3d2a00; box-shadow: 0 12px 28px rgba(245,158,11,.32); }
.btn-gold:hover { background: #ea8f08; transform: translateY(-2px); }

.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-soft); }

.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); color:#fff; }

.btn-sm { padding: 9px 15px; font-size: .86rem; }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-google {
  background:#fff; color: var(--ink); border-color: var(--line); width:100%;
}
.btn-google:hover { background: var(--bg-soft); border-color: var(--muted-2); }
.btn-google svg { width: 20px; height: 20px; }

.btn-link { background: none; border: none; color: var(--brand-600); font-weight: 700; cursor: pointer; font-family: var(--font-head); padding: 0; }
.btn-link:hover { color: var(--brand-700); text-decoration: underline; }

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card.hover:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--brand-soft-2); }

.card-icon {
  width: 54px; height: 54px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-600); margin-bottom: 16px;
}
.card-icon.gold { background: var(--gold-soft); color: #b45309; }
.card-icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 8px; font-size: 1.2rem; }
.card p { color: var(--muted); margin: 0; font-size: .96rem; }

/* Step card */
.step {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px 26px; box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.step:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.step-num {
  position: absolute; top: -18px; left: 26px;
  width: 44px; height: 44px; border-radius: 13px; background: var(--ink); color: #fff;
  font-family: var(--font-head); font-weight: 800; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.step:nth-child(4n+1) .step-num { background: var(--brand); }
.step:nth-child(4n+2) .step-num { background: var(--gold); color:#3d2a00; }
.step:nth-child(4n+3) .step-num { background: var(--brand-700); }
.step:nth-child(4n) .step-num { background: var(--ink); }
.step h3 { margin: 12px 0 6px; font-size: 1.18rem; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }

/* Stat */
.stat { text-align: center; padding: 26px 18px; }
.stat-num { font-family: var(--font-head); font-weight: 800; font-size: 2.2rem; color: var(--brand-600); line-height: 1; }
.stat-label { color: var(--muted); font-weight: 600; margin-top: 8px; font-size: .95rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head);
  font-weight: 700; font-size: .78rem; padding: 5px 11px; border-radius: 999px;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-700); }
.badge-gold { background: var(--gold-soft); color: #b45309; }
.badge-new { background: #e0f2fe; color: #075985; }
.badge-muted { background: #f1f5f9; color: var(--muted); }
.badge svg { width: 14px; height: 14px; }

/* Points pill */
.points {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-head); font-weight: 800;
  color: #b45309; background: var(--gold-soft); padding: 6px 13px; border-radius: 999px; font-size: 1rem;
}
.points svg { width: 16px; height: 16px; }

/* ---------- Survey / Reward cards ---------- */
.survey-card, .reward-card { display: flex; flex-direction: column; }
.survey-card .meta { display: flex; gap: 14px; color: var(--muted); font-size: .9rem; font-weight: 600; margin: 6px 0 16px; flex-wrap: wrap; }
.survey-card .meta span { display: inline-flex; align-items: center; gap: 6px; }
.survey-card .meta svg { width: 15px; height: 15px; color: var(--muted-2); }
.survey-card .row, .reward-card .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 12px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }

.reward-thumb {
  height: 148px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: #fff; position: relative; overflow: hidden;
}
.reward-thumb svg { width: 54px; height: 54px; opacity: .95; }
.rt-giftcard { background: linear-gradient(135deg, #059669, #10b981); }
.rt-shopping { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.rt-digital { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.rt-cashback { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.rt-other { background: linear-gradient(135deg, #ec4899, #f472b6); }

/* ---------- Filters (chips) ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.filter-chip {
  font-family: var(--font-head); font-weight: 700; font-size: .9rem; padding: 9px 17px;
  border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
  transition: all .18s ease;
}
.filter-chip:hover { border-color: var(--brand-400); color: var(--brand-700); }
.filter-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.empty-state { text-align: center; padding: 46px; color: var(--muted); grid-column: 1 / -1; }

/* ---------- Forms ---------- */
.form-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow); max-width: 480px; margin: 0 auto; width: 100%;
}
.form-card.wide { max-width: 760px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label { font-family: var(--font-head); font-weight: 700; font-size: .88rem; margin-bottom: 7px; color: var(--ink-2); }
.field label .req { color: #dc2626; }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: .98rem; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); transition: border-color .18s ease, box-shadow .18s ease;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(5,150,105,.13);
}
.field input.invalid, .field select.invalid, .field textarea.invalid { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220,38,38,.1); }
.field .error-msg { color: #dc2626; font-size: .82rem; margin-top: 5px; font-weight: 600; display: none; }
.field.has-error .error-msg { display: block; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; font-size: .92rem; color: var(--muted); }
.checkbox-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex-shrink: 0; }

.form-divider { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: .85rem; margin: 22px 0; }
.form-divider::before, .form-divider::after { content:""; flex:1; height:1px; background: var(--line); }

.form-alt { text-align: center; margin-top: 22px; color: var(--muted); font-size: .95rem; }
.form-error {
  display: none; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 600; margin-bottom: 18px;
}
.form-error.show { display: block; animation: pop .3s ease; }
.form-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: .9rem; }

.form-success {
  display: none; text-align: center; padding: 20px 0;
}
.form-success.show { display: block; animation: pop .4s ease; }
.form-success .check-circle {
  width: 74px; height: 74px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.form-success .check-circle svg { width: 40px; height: 40px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.auth-wrap { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; padding: 50px 0;
  background: radial-gradient(700px 400px at 80% 0%, var(--brand-soft), transparent 60%); }
.auth-aside h1 { margin-bottom: 16px; }
.auth-aside .bullet { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.auth-aside .bullet svg { width: 22px; height: 22px; color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.auth-aside .bullet b { font-family: var(--font-head); }

/* ---------- Accordion (FAQ) ---------- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-header {
  width: 100%; text-align: left; background: #fff; border: none; cursor: pointer;
  padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.04rem; color: var(--ink);
  transition: background .18s ease;
}
.acc-header:hover { background: var(--bg-soft); }
.acc-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center; transition: transform .28s ease, background .2s ease; }
.acc-icon svg { width: 18px; height: 18px; }
.acc-item.open .acc-icon { transform: rotate(45deg); background: var(--brand); color: #fff; }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.acc-body-inner { padding: 0 24px 22px; color: var(--muted); }

/* ---------- Points calculator ---------- */
.calc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow);
}
.calc-option {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.calc-option:hover { border-color: var(--brand-400); }
.calc-option.checked { border-color: var(--brand); background: var(--brand-soft); }
.calc-option .left { display: flex; align-items: center; gap: 12px; }
.calc-option input { width: 20px; height: 20px; accent-color: var(--brand); }
.calc-total {
  margin-top: 20px; padding: 22px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(120deg, var(--brand-700), var(--brand)); color: #fff;
}
.calc-total .n { font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; line-height: 1; }
.calc-total .l { opacity: .9; font-weight: 600; }

/* ---------- Testimonials ---------- */
.tcard { display: flex; flex-direction: column; height: 100%; }
.tcard .stars { color: var(--gold); display: flex; gap: 2px; margin-bottom: 12px; }
.tcard .stars svg { width: 18px; height: 18px; }
.tcard blockquote { font-size: 1.05rem; color: var(--ink-2); margin: 0 0 20px; line-height: 1.6; font-weight: 500; }
.tcard .who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; color: #fff; flex-shrink: 0; }
.tcard .who b { display: block; font-family: var(--font-head); }
.tcard .who span { color: var(--muted); font-size: .88rem; }

/* ---------- Trust list ---------- */
.trust-list { list-style: none; display: grid; gap: 14px; }
.trust-list li { display: flex; gap: 12px; align-items: flex-start; }
.trust-list svg { width: 22px; height: 22px; color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.trust-list b { font-family: var(--font-head); }

/* ---------- Dashboard ---------- */
.dash-wrap { background: var(--bg-soft); min-height: calc(100vh - var(--header-h)); padding: 36px 0 60px; }
.dash-welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.dash-welcome h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.dash-welcome p { margin: 4px 0 0; color: var(--muted); }

.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.stat-card .ic { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.stat-card .ic svg { width: 22px; height: 22px; }
.stat-card .v { font-family: var(--font-head); font-weight: 800; font-size: 1.9rem; color: var(--ink); line-height: 1; }
.stat-card .l { color: var(--muted); font-weight: 600; margin-top: 6px; font-size: .9rem; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: 1.15rem; }

.activity { list-style: none; display: flex; flex-direction: column; }
.activity li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: none; }
.activity .ic { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity .ic svg { width: 19px; height: 19px; }
.activity .txt { flex: 1; }
.activity .txt b { font-family: var(--font-head); font-size: .96rem; }
.activity .txt span { display: block; color: var(--muted-2); font-size: .82rem; }
.activity .amt { font-family: var(--font-head); font-weight: 800; }
.amt.plus { color: var(--brand-600); }
.amt.minus { color: #dc2626; }

/* Progress bars */
.progress { height: 12px; background: var(--bg-soft-2); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-400)); transition: width 1s ease; }
.progress.gold .bar { background: linear-gradient(90deg, var(--gold), #fbbf24); }
.progress-label { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 600; margin-bottom: 8px; color: var(--ink-2); }

/* ---------- Welcome popup ---------- */
.popup-overlay {
  position: fixed; inset: 0; z-index: 3000; background: rgba(15,23,42,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.popup-overlay.show { opacity: 1; visibility: visible; }
.popup {
  background: #fff; border-radius: var(--radius-lg); max-width: 440px; width: 100%; padding: 38px 34px 32px;
  text-align: center; box-shadow: var(--shadow-lg); position: relative; transform: translateY(20px) scale(.97);
  transition: transform .32s cubic-bezier(.2,.8,.2,1);
}
.popup-overlay.show .popup { transform: none; }
.popup .p-icon { width: 72px; height: 72px; margin: 0 auto 18px; }
.popup .p-icon svg { width: 72px; height: 72px; }
.footer-brand .brand span svg { width: 40px; height: 40px; }
.popup h2 { font-size: 1.5rem; margin-bottom: 10px; }
.popup p { color: var(--muted); margin-bottom: 24px; }
.popup .popup-actions { display: flex; flex-direction: column; gap: 10px; }
.popup-close {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px; border: none;
  background: var(--bg-soft); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.popup-close:hover { background: var(--line); color: var(--ink); }
.popup-close svg { width: 20px; height: 20px; }

/* ---------- Download / dev area ---------- */
.dev-area { background: #0b1220; color: #cbd5e1; }
.dev-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-lg);
  padding: 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 34px; align-items: center;
}
.dev-card h2 { color: #fff; }
.dev-card p { color: #94a3b8; }
.file-tree {
  background: #060a13; border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm); padding: 20px 22px;
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; color: #93c5b3;
  line-height: 1.9; max-height: 320px; overflow: auto; display: none; max-width: 100%; white-space: pre-wrap; word-break: break-word;
}
.file-tree.show { display: block; }
.file-tree .dir { color: #fbbf24; }
.download-status { margin-top: 14px; font-size: .9rem; color: var(--brand-400); font-weight: 700; min-height: 20px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(30px);
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: .93rem;
  box-shadow: var(--shadow-lg); z-index: 4000; opacity: 0; transition: opacity .3s ease, transform .3s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 18px; height: 18px; color: var(--brand-400); }

/* Spinner */
.spinner {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto;
  border: 4px solid var(--brand-soft-2); border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Back to top */
.back-top {
  position: fixed; bottom: 24px; right: 24px; width: 48px; height: 48px; border-radius: 14px; border: none;
  background: var(--brand); color: #fff; cursor: pointer; box-shadow: var(--shadow-brand); z-index: 900;
  display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease, transform .2s ease;
}
.back-top.show { opacity: 1; visibility: visible; }
.back-top:hover { transform: translateY(-3px); }
.back-top svg { width: 22px; height: 22px; }

/* Prose (legal pages) */
.prose { max-width: 800px; }
.prose h2 { margin-top: 40px; font-size: 1.5rem; }
.prose h3 { margin-top: 26px; font-size: 1.15rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 22px; list-style: disc; margin-bottom: 16px; }
.prose li { margin-bottom: 8px; }
.prose .toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-bottom: 30px; }
.prose .toc ul { list-style: none; padding: 0; columns: 2; }
.prose .updated { color: var(--muted); font-size: .9rem; }
