/* Styles for the signed-in app (dashboard, live call, admin), auth and legal pages.
   Builds on the tokens and buttons in styles.css. */

body.app { background: var(--bg); min-height: 100vh; }
.app-top {
  position: sticky; top: 0; z-index: 40; background: rgba(247,248,243,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-top-inner { width: min(1180px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: 12px; height: 64px; }
.app-top .logo { font-size: 18px; }
.app-top .spacer { flex: 1; }
.balance-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.balance-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--green-2); }
.balance-chip.low i { background: #f59e0b; }
.balance-chip.empty i { background: var(--red); }
.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.menu.open .menu-panel { display: block; }
.menu-panel a, .menu-panel button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 9px; border: 0; background: none; font-size: 14px; color: var(--ink); }
.menu-panel a:hover, .menu-panel button:hover { background: var(--bg); }
.menu-panel .who { padding: 10px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #e7f8ec; color: #166534; font-weight: 700; }

.page { width: min(1180px, 100% - 32px); margin: 28px auto 80px; }
.page-narrow { width: min(760px, 100% - 32px); margin: 40px auto 80px; }
.page h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 600; letter-spacing: -.035em; }
.page-sub { color: var(--muted); margin-top: 6px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm); }
.card h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.stack { display: grid; gap: 20px; }
.stack > *, .call-main > *, .live > *, .ended-grid > * { min-width: 0; } /* let wide tables scroll instead of widening the page */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Banners & toasts */
.banner { padding: 14px 18px; border-radius: 14px; border: 1px solid; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.banner.ok { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.banner.warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.banner.err { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.banner a { text-decoration: underline; font-weight: 600; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: drop .2s ease; }
.toast.err { background: #991b1b; }
.toast.ok { background: #166534; }

/* Forms */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; font: inherit; font-size: 15px; padding: 11px 13px; border-radius: 11px; border: 1px solid #d9dcd3; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 120px; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; flex: none; }
.check a { text-decoration: underline; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(0,0,0,.05); }
.link { color: var(--green); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; position: relative; overflow: hidden; }
.auth-wrap .hero-glow { top: -300px; }
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: var(--shadow-lg); display: grid; gap: 18px; }
.auth-card h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.auth-card .logo { justify-self: start; }
.trial-pill { display: inline-flex; gap: 6px; align-items: center; background: var(--green-soft); color: #166534; font-weight: 600; font-size: 13px; padding: 5px 10px; border-radius: 99px; justify-self: start; }
.form-error { color: #b91c1c; font-size: 14px; min-height: 1em; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 10px; border-bottom: 1px solid #f0f1ec; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.actions { text-align: right; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.pill.live { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.pill.ready, .pill.success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.pill.ended { color: var(--muted); }
.pill.pending { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.pill.failed { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan { border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 6px; background: #fff; position: relative; }
.plan.popular { border-color: #86efac; box-shadow: 0 0 0 4px rgba(34,197,94,.1); }
.plan .tag { position: absolute; top: 14px; right: 14px; }
.plan h3 { font-size: 18px; font-weight: 600; }
.plan .price { font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin-top: 6px; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan .per { font-size: 13px; color: var(--muted); }
.plan .btn { margin-top: 12px; justify-content: center; }
.pay-methods { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-top: 14px; }
.pay-methods span.pm { font-weight: 700; font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 9px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10,12,10,.5); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal-bg[hidden] { display: none; }
.modal-card { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 22px; padding: 26px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; }
.modal-card h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }

/* CV card, style picker, uploads */
.steps-list { margin: 12px 0 0; padding-left: 20px; line-height: 1.9; }
.card-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); color: #166534; display: grid; place-items: center; flex: none; }
.card-ico .icon { width: 20px; height: 20px; }
.file-btn { cursor: pointer; }
.cv-preview { margin-top: 14px; padding: 12px 14px; background: #f6f8f3; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; max-height: 120px; overflow: hidden; position: relative; }
.cv-preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(transparent, #f6f8f3); }
.modal-wide { width: min(760px, 100%); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.tool { display: grid; gap: 4px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcf9; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tool:hover { border-color: #86efac; box-shadow: 0 0 0 4px rgba(34,197,94,.1); transform: translateY(-1px); }
.tool .card-ico { margin-bottom: 6px; }
.tool b { font-size: 16px; }
.tool > span:last-child { font-size: 13.5px; color: var(--muted); }
.quote-card { margin: 0; position: relative; padding: 22px 24px 20px 66px; border: 1px solid #bbf7d0; border-radius: 20px; background: linear-gradient(135deg, #f0fdf4, #fbfcf9 70%); animation: drop .3s ease; }
.quote-card::before { content: "\201C"; position: absolute; left: 20px; top: 10px; font: 700 64px/1 Georgia, "Times New Roman", serif; color: var(--green-2); }
.quote-card blockquote { margin: 0; font-size: 18px; line-height: 1.5; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.quote-card.long blockquote { font-size: 15.5px; line-height: 1.55; }
.quote-card figcaption { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 14.5px; }
.quote-card figcaption b { color: #166534; font-weight: 600; }
.quote-card figcaption b::before { content: "— "; }
.quote-card figcaption span { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) {
  .quote-card { padding: 18px 18px 16px 52px; }
  .quote-card::before { left: 14px; top: 8px; font-size: 52px; }
  .quote-card blockquote { font-size: 16px; }
  .quote-card.long blockquote { font-size: 14.5px; }
}
.icon-btn { padding: 6px; }
.icon-btn .icon { width: 18px; height: 18px; }
.btn .icon { width: 16px; height: 16px; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.style-opt { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; background: #fff; }
.style-opt input { position: absolute; opacity: 0; pointer-events: none; }
.style-opt b { font-size: 14px; }
.style-opt span { font-size: 12px; color: var(--muted); }
.style-opt:has(input:checked) { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(34,197,94,.15); background: #f6fdf8; }
.style-opt:has(input:focus-visible) { outline: 2px solid var(--green-2); outline-offset: 2px; }
.length-row { margin-top: 6px; gap: 10px; }
.seg-pills { display: inline-flex; padding: 3px; border-radius: 11px; background: #eceee7; gap: 2px; }
.seg-pills label { position: relative; }
.seg-pills input { position: absolute; opacity: 0; pointer-events: none; }
.seg-pills span { display: block; padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-pills input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.seg-pills input:focus-visible + span { outline: 2px solid var(--green-2); }
.uploading { opacity: .6; pointer-events: none; }

/* Markdown output */
.md { line-height: 1.6; font-size: 15px; overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md li { margin: 3px 0; }
.md h2, .md h3, .md h4 { font-size: 16px; margin: 14px 0 6px; letter-spacing: -.01em; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md code { font-family: var(--mono); font-size: .9em; background: #f1f3ee; padding: 1px 5px; border-radius: 5px; }
.md pre { background: #0f1210; color: #e5e7e2; border-radius: 12px; padding: 14px 16px; overflow-x: auto; margin: 0 0 10px; }
.md pre code { background: none; padding: 0; color: inherit; font-size: 13px; line-height: 1.6; }
.md > :last-child { margin-bottom: 0; }

/* Legal pages */
.legal h1 { font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; letter-spacing: -.02em; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--green); text-decoration: underline; }

@media (max-width: 760px) {
  .plans { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; border-radius: 16px; }
  .table-scroll { margin: 0 -18px; padding: 0 18px; }
  .hide-mobile { display: none !important; }
  .auth-card { padding: 24px; }
}
