/* WebtasticAI — aplicatii/apps.css
   Stratul de bază (tokens, tipografie, nav, butoane, carduri,
   footer, reveal) și componentele comune trăiesc acum în
   /assets/wt-system.css și /assets/wt-components.css.
   Aici rămâne DOAR ce e propriu uneltelor. */
@import url("/assets/wt-system.css");
@import url("/assets/wt-components.css");

/* ============================================================
   APP / TOOL COMPONENTS
   ============================================================ */

/* Compact page hero for tools */
.app-hero { position: relative; padding-top: clamp(2rem, 4vw, 3.5rem); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); overflow: clip; }
.app-hero .blob-1 { width: 480px; height: 480px; top: -200px; left: -140px; background: radial-gradient(circle, var(--purple) 0%, transparent 70%); }
.app-hero .blob-2 { width: 380px; height: 380px; top: -60px; right: -140px; background: radial-gradient(circle, var(--lime-bright) 0%, transparent 70%); opacity: 0.35; }
.app-hero .container { position: relative; z-index: var(--z-raised); }
.app-hero h1 { margin-top: 1rem; max-width: 22ch; }
.app-hero .lede { margin-top: 1rem; }
.app-badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.95rem; border-radius: var(--r-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.app-badge svg { width: 16px; height: 16px; color: var(--lime); }

.breadcrumb { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; color: var(--text-dimmer); font-weight: 600; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--purple); }

/* Tool layout: inputs left, results right */
.tool { padding-bottom: clamp(2rem, 5vw, 4rem); position: relative; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.2rem, 2.5vw, 2rem); align-items: start; }
@media (max-width: 860px) { .tool-layout { grid-template-columns: 1fr; } }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field > label { font-weight: 700; font-size: 0.92rem; }
.field .hint { font-size: 0.82rem; color: var(--text-dimmer); font-weight: 500; }
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field input[type="email"],
.field select, .field textarea {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 0.75rem 0.9rem; width: 100%;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(123, 47, 255, 0.15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.form-stack { display: flex; flex-direction: column; gap: 1rem; }

.check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.95rem; color: var(--text-dim); font-weight: 500; cursor: pointer; }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--purple); cursor: pointer; flex: none; }

/* Segmented control */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-tint); border-radius: var(--r-pill); border: 1px solid var(--border); }
.seg button {
  padding: 0.55rem 1.15rem; border-radius: var(--r-pill); font-weight: 700; font-size: 0.92rem;
  color: var(--text-dim); transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.seg button[aria-pressed="true"] { background: var(--purple); color: #fff; box-shadow: var(--glow-brand-soft); }

/* Results */
.result-hero { text-align: center; padding: 1.4rem 1rem 1.6rem; border-radius: var(--r-md); background: linear-gradient(150deg, #5415D4 0%, #7B2FFF 60%, #6A25E8 100%); color: #fff; box-shadow: var(--glow-brand-soft); }
.result-hero .rh-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; }
.result-hero .rh-value { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.1rem, 1.7rem + 1.8vw, 2.9rem); line-height: 1; letter-spacing: -0.03em; margin-top: 0.35rem; }
.result-hero .rh-sub { font-size: 0.9rem; opacity: 0.85; margin-top: 0.4rem; font-weight: 600; }

.result-rows { display: flex; flex-direction: column; margin-top: 1rem; }
.result-rows .rr { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.result-rows .rr:last-child { border-bottom: none; }
.result-rows .rr .k { color: var(--text-dim); font-weight: 600; }
.result-rows .rr .v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-rows .rr.total { border-top: 2px solid var(--border-strong); margin-top: 0.3rem; padding-top: 0.9rem; }
.result-rows .rr.total .k, .result-rows .rr.total .v { color: var(--text); font-weight: 800; font-size: 1.05rem; }
.result-rows .rr .v.good { color: var(--lime-text); }
.result-rows .rr .v.bad { color: var(--red); }

/* Compare cards (PFA vs SRL) */
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.compare-card { position: relative; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 1.3rem; }
.compare-card.win { border-color: var(--lime); box-shadow: var(--glow-lime); }
.compare-card .cc-tag { position: absolute; top: -12px; left: 1rem; background: var(--lime); color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 10px; border-radius: var(--r-pill); }
.compare-card h3 { font-size: 1.02rem; margin-bottom: 0.2rem; }
.compare-card .cc-sub { font-size: 0.8rem; color: var(--text-dimmer); font-weight: 600; }
.compare-card .cc-net { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; letter-spacing: -0.02em; margin-top: 0.7rem; font-variant-numeric: tabular-nums; }
.compare-card .cc-netlabel { font-size: 0.78rem; color: var(--text-dimmer); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.compare-card .result-rows .rr { padding: 0.45rem 0; font-size: 0.86rem; }

/* Progress bar (prag TVA / micro) */
.meter { margin-top: 0.9rem; }
.meter .meter-track { height: 14px; border-radius: var(--r-pill); background: var(--bg-tint); border: 1px solid var(--border); overflow: hidden; }
.meter .meter-fill { height: 100%; width: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--lime-bright), var(--lime)); transform-origin: left center; transform: scaleX(0); transition: transform var(--dur-slow) var(--ease-out-expo), background var(--dur); }
.meter.warn .meter-fill { background: linear-gradient(90deg, var(--orange), var(--orange-deep)); }
.meter.over .meter-fill { background: linear-gradient(90deg, var(--red), #c02626); }
.meter .meter-legend { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-dimmer); font-weight: 600; margin-top: 0.4rem; }

/* Notes & disclaimers */
.note {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: var(--bg-tint); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0.95rem 1.1rem;
  font-size: 0.88rem; color: var(--text-dim);
}
.note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--purple); }
.note.warn svg { color: var(--orange); }
.note a { color: var(--purple); font-weight: 700; }

/* Output / generated text */
.output-box {
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r-md);
  padding: 1.2rem 1.3rem; max-height: 480px; overflow: auto; font-size: 0.92rem; color: var(--text);
}
.output-box h2 { font-size: 1.25rem; margin: 1.2rem 0 0.5rem; }
.output-box h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.output-box p, .output-box li { color: var(--text-dim); margin-bottom: 0.5rem; }
.output-box ul { list-style: disc; padding-left: 1.2rem; }
.output-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

/* Toast feedback */
.toast {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 0.92rem;
  padding: 0.8rem 1.4rem; border-radius: var(--r-pill); box-shadow: var(--shadow-card);
  opacity: 0; visibility: hidden; transition: opacity var(--dur), transform var(--dur) var(--ease-out-expo), visibility var(--dur);
  z-index: var(--z-toast); max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* Upsell CTA panel (one orange action per page) */
.tool-cta { margin-top: clamp(2.5rem, 5vw, 4rem); }
.tool-cta .cta-panel {
  position: relative; overflow: hidden; border-radius: var(--r-xl); text-align: center;
  padding: clamp(2rem, 1.6rem + 3vw, 3.5rem) clamp(1.3rem, 1rem + 2vw, 2.5rem);
  background: linear-gradient(150deg, #5415D4 0%, #7B2FFF 55%, #4A1FB0 100%);
  box-shadow: var(--glow-brand);
}
.tool-cta h2 { color: #fff; position: relative; z-index: 1; font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.3rem); }
.tool-cta p { color: rgba(255,255,255,0.85); position: relative; z-index: 1; max-width: 52ch; margin: 0.9rem auto 1.6rem; }
.tool-cta .cta-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.tool-cta .blob { filter: blur(60px); }
.tool-cta .cta-blob { width: 300px; height: 300px; top: -90px; right: -50px; background: radial-gradient(circle, var(--lime-bright) 0%, transparent 70%); opacity: 0.3; }
.btn-light-ghost { background: rgba(255,255,255,0.08); color: #fff; border: 1.5px solid rgba(255,255,255,0.5); }
.btn-light-ghost:hover { background: rgba(255,255,255,0.16); border-color: #fff; transform: translateY(-2px); }

/* ---- Hub page: app cards ---- */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.2rem; margin-top: 2rem; position: relative; z-index: var(--z-raised); }
.app-card {
  display: flex; flex-direction: column; gap: 0.8rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.6rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur) var(--ease-out-quart), box-shadow var(--dur), border-color var(--dur-fast);
}
.app-card:hover { transform: translateY(-5px); box-shadow: var(--glow-brand-soft); border-color: rgba(123,47,255,0.35); }
.app-card .ac-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-tint); color: var(--purple); }
.app-card .ac-icon svg { width: 24px; height: 24px; }
.app-card h3 { font-size: 1.15rem; }
.app-card p { color: var(--text-dim); font-size: 0.94rem; flex: 1; }
.app-card .ac-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.app-card .ac-tag { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(101,163,13,0.12); color: var(--lime-text); border: 1px solid rgba(101,163,13,0.3); }
.app-card .ac-go { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--purple); font-weight: 700; font-size: 0.95rem; margin-top: 0.2rem; }
.app-card .ac-go svg { width: 17px; height: 17px; transition: transform var(--dur-fast); }
.app-card:hover .ac-go svg { transform: translateX(4px); }

/* ---- Invoice builder ---- */
.inv-items { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.inv-items th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dimmer); padding: 0.4rem 0.4rem; }
.inv-items td { padding: 0.3rem 0.25rem; vertical-align: middle; }
.inv-items input { font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-xs); padding: 0.5rem 0.6rem; width: 100%; }
.inv-items input:focus { outline: none; border-color: var(--purple); }
.inv-items .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-items .rm { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-dimmer); border: 1px solid var(--border); background: var(--surface); }
.inv-items .rm:hover { color: var(--red); border-color: var(--red); }
.inv-items .rm svg { width: 15px; height: 15px; }

/* Invoice preview (A4-ish) */
.inv-preview {
  background: #fff; color: #111827; border: 1px solid var(--border);
  border-radius: var(--r-md); padding: clamp(1.4rem, 3vw, 2.6rem);
  box-shadow: var(--shadow-card); font-size: 0.9rem; line-height: 1.5;
}
.inv-preview .ip-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; border-bottom: 2px solid #7B2FFF; padding-bottom: 1.1rem; margin-bottom: 1.3rem; }
.inv-preview .ip-title { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; letter-spacing: -0.02em; color: #150B33; }
.inv-preview .ip-meta { font-size: 0.86rem; color: #4b5563; }
.inv-preview .ip-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.4rem; }
@media (max-width: 560px) { .inv-preview .ip-parties { grid-template-columns: 1fr; } }
.inv-preview .ip-party h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #7B2FFF; margin-bottom: 0.4rem; font-family: var(--font-body); }
.inv-preview .ip-party div { font-size: 0.88rem; color: #374151; }
.inv-preview .ip-party .pn { font-weight: 800; color: #111827; font-size: 0.98rem; }
.inv-preview table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.inv-preview table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; border-bottom: 1.5px solid #e5e7eb; padding: 0.45rem 0.4rem; }
.inv-preview table td { padding: 0.55rem 0.4rem; border-bottom: 1px solid #f3f4f6; color: #1f2937; }
.inv-preview table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-preview .ip-totals { margin-left: auto; max-width: 300px; }
.inv-preview .ip-totals .rr { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0.4rem; font-size: 0.9rem; color: #374151; }
.inv-preview .ip-totals .rr.grand { border-top: 2px solid #7B2FFF; margin-top: 0.4rem; padding-top: 0.6rem; font-weight: 800; color: #111827; font-size: 1.05rem; }
.inv-preview .ip-foot { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; font-size: 0.8rem; color: #6b7280; }

/* Print: only the invoice */
@media print {
  body * { visibility: hidden; }
  #invPreview, #invPreview * { visibility: visible; }
  #invPreview { position: absolute; inset: 0; width: 100%; border: none; box-shadow: none; border-radius: 0; padding: 0.5cm; }
  .nav-wrap, .footer, .tool-cta, .toast { display: none !important; }
  @page { margin: 1.2cm; }
}

/* ---- Notă sub CTA: trimite spre articolul care explică „de ce" ----
   Unealta rezolvă nevoia imediată; articolul rezolvă intenția din
   spate. Le ținem distincte ca să nu concureze pe aceleași căutări. */
.tool-cta .cta-aside {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  opacity: 0.85;
}
.tool-cta .cta-aside a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.tool-cta .cta-aside a:hover { opacity: 1; }
