/*
Theme Name: ThickGrass-ServicePortal
Theme URI: https://innovalink.ro
Author: Marius Stanica
Author URI: https://innovalink.ro
Description: The customer-facing support portal companion theme for the ThickGrass helpdesk plugin — a clean, branded front end for opening tickets, tracking them, browsing the knowledge base, and chatting with support. Ships alongside the plugin as a ready-made portal; requires ThickGrass to be installed and active.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: thickgrass-serviceportal
*/

/* ---------- Design tokens (mirrors the ThickGrass plugin palette) ---------- */
:root{
  --tg-brand:         #1B8A5A;
  --tg-brand-hover:   #146B45;
  --tg-brand-light:   #E6F6EF;
  --tg-amber:         #F4B942;

  --tg-grey-50:  #F7F8F9;
  --tg-grey-100: #EEF0F2;
  --tg-grey-200: #DFE3E6;
  --tg-grey-400: #8C9196;
  --tg-grey-700: #44546F;
  --tg-grey-900: #172B4D;

  --tg-info:          #0C66E4;
  --tg-info-light:    #E9F2FF;
  --tg-warning:       #B45309;
  --tg-warning-light: #FEF3E2;
  --tg-danger:        #C9372C;
  --tg-danger-light:  #FFECEB;

  --tg-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tg-radius: 14px;
  --tg-radius-sm: 8px;
  --tg-shadow: 0 1px 2px rgba(23,43,77,.06), 0 4px 16px rgba(23,43,77,.06);
  --tg-container: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--tg-font);
  color:var(--tg-grey-700);
  background:#FFFFFF;
  line-height:1.6;
  font-size:16px;
}
img{ max-width:100%; height:auto; display:block; }
a{ color:var(--tg-brand); text-decoration:none; }
a:hover{ color:var(--tg-brand-hover); }
ul,ol{ padding-left:1.25em; }
h1,h2,h3,h4{ color:var(--tg-grey-900); line-height:1.25; margin:0 0 .5em; font-weight:700; }
h1{ font-size:clamp(2rem,4vw,2.75rem); }
h2{ font-size:clamp(1.5rem,3vw,2.1rem); }
h3{ font-size:1.25rem; }
p{ margin:0 0 1em; }
table{ border-collapse:collapse; width:100%; }
button{ font-family:inherit; }

/* ---------- Layout helpers ---------- */
.tg-container{ max-width:var(--tg-container); margin:0 auto; padding:0 24px; }
.tg-section{ padding:64px 0; }
.tg-section--alt{ background:var(--tg-grey-50); }
.tg-section--brand{ background:linear-gradient(135deg,#1a7a4c,#0d5132); color:#fff; }
.tg-section--brand h1, .tg-section--brand h2{ color:#fff; }
.tg-section-head{ max-width:640px; margin:0 auto 40px; text-align:center; }
.tg-section-head p{ color:var(--tg-grey-400); }
.tg-eyebrow{
  display:inline-block; font-size:.8rem; font-weight:700; letter-spacing:.04em;
  text-transform:uppercase; color:var(--tg-brand); background:var(--tg-brand-light);
  padding:4px 12px; border-radius:999px; margin-bottom:14px;
}
@media (max-width:640px){ .tg-section{ padding:44px 0; } }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 22px; border-radius:999px; font-weight:600; font-size:.95rem;
  border:2px solid transparent; cursor:pointer; transition:.15s ease;
}
.btn-primary{ background:var(--tg-brand); color:#fff; }
.btn-primary:hover{ background:var(--tg-brand-hover); color:#fff; }
.btn-secondary{ background:#fff; color:var(--tg-brand); border-color:var(--tg-grey-200); }
.btn-secondary:hover{ border-color:var(--tg-brand); color:var(--tg-brand-hover); }
.btn-on-brand{ background:#fff; color:var(--tg-brand-hover); }
.btn-on-brand:hover{ background:var(--tg-brand-light); }
.btn-block{ width:100%; }
.tg-cta-row{ display:flex; gap:14px; flex-wrap:wrap; }

/* ---------- Header ---------- */
.tg-header{
  position:sticky; top:0; z-index:50; background:#fff;
  border-bottom:1px solid var(--tg-grey-200);
  transition:box-shadow .2s ease, padding .2s ease;
}
.tg-header.is-scrolled{ box-shadow:0 2px 12px rgba(23,43,77,.08); }
.tg-header-inner{ display:flex; align-items:center; justify-content:space-between; padding:14px 24px; max-width:var(--tg-container); margin:0 auto; transition:padding .2s ease; }
.tg-header.is-scrolled .tg-header-inner{ padding-top:10px; padding-bottom:10px; }
.tg-logo{ display:flex; align-items:center; gap:10px; font-weight:700; color:var(--tg-grey-900); font-size:1.15rem; }
.tg-logo img{ height:36px; width:auto; }
.tg-nav{ display:flex; align-items:center; gap:28px; }
.tg-nav ul{ list-style:none; margin:0; padding:0; display:flex; gap:22px; }
.tg-nav a{ color:var(--tg-grey-700); font-weight:600; font-size:.95rem; white-space:nowrap; }
.tg-nav a:hover{ color:var(--tg-brand); }
.tg-header-actions{ display:flex; align-items:center; gap:14px; }
.tg-menu-toggle{
  display:none; flex-direction:column; gap:5px; background:none; border:none; padding:6px; cursor:pointer;
}
.tg-menu-toggle span{ width:24px; height:2px; background:var(--tg-grey-900); border-radius:2px; }

/* Only one "Get a Quote" button at a time: the header-actions one on desktop,
   the in-menu one on mobile (inside the collapsed dropdown). */
.tg-nav-cta{ display:none; }

@media (max-width:900px){
  .tg-nav{
    position:absolute; top:100%; left:0; right:0; background:#fff; flex-direction:column; align-items:stretch;
    border-bottom:1px solid var(--tg-grey-200); padding:10px 24px 20px; display:none;
  }
  .tg-nav.is-open{ display:flex; }
  .tg-nav ul{ flex-direction:column; gap:4px; }
  .tg-nav ul a{ display:block; padding:10px 0; }
  .tg-header-actions .btn{ display:none; }
  .tg-nav-cta{ display:inline-flex; margin-top:10px; }
  .tg-menu-toggle{ display:flex; }
}

/* ---------- Hero ---------- */
.tg-hero{ display:grid; grid-template-columns:1.1fr 1fr; gap:48px; align-items:center; }
.tg-hero p.tg-lead{ font-size:1.15rem; color:var(--tg-grey-700); }
@media (max-width:900px){ .tg-hero{ grid-template-columns:1fr; } .tg-hero-media{ order:-1; } }

/* ---------- Value props / feature grid ---------- */
.tg-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:24px; }
.tg-grid--2{ grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); }
.tg-card{
  background:#fff; border:1px solid var(--tg-grey-200); border-radius:var(--tg-radius);
  padding:28px; box-shadow:var(--tg-shadow);
}
.tg-card h3{ margin-bottom:8px; }
.tg-card p{ color:var(--tg-grey-400); margin-bottom:0; }
.tg-icon-badge{ width:56px; height:56px; margin-bottom:16px; }
.tg-icon-badge img{ width:100%; height:100%; }

/* ---------- How it works image block ---------- */
.tg-diagram{ background:#fff; border:1px solid var(--tg-grey-200); border-radius:var(--tg-radius); padding:24px; }

/* ---------- Feature groups (Features page) ---------- */
.tg-feature-group{ margin-bottom:56px; }
.tg-feature-group:last-child{ margin-bottom:0; }
.tg-feature-group-head{ display:flex; align-items:center; gap:16px; margin-bottom:22px; }
.tg-feature-group-head .tg-icon-badge{ margin:0; flex:none; }
.tg-feature-group ul{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px 28px; }
.tg-feature-group li{ padding-left:26px; position:relative; }
.tg-feature-group li::before{
  content:""; position:absolute; left:0; top:9px; width:9px; height:9px; border-radius:50%;
  background:var(--tg-brand);
}
.tg-feature-group li strong{ color:var(--tg-grey-900); }
.tg-badge-new{
  display:inline-block; font-size:.68rem; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  color:#0d5132; background:var(--tg-amber); padding:2px 8px; border-radius:999px; margin-left:8px; vertical-align:middle;
}

/* ---------- Tables (Documentation page) ---------- */
.tg-table-wrap{ overflow-x:auto; border:1px solid var(--tg-grey-200); border-radius:var(--tg-radius-sm); }
.tg-table{ font-size:.94rem; }
.tg-table th, .tg-table td{ text-align:left; padding:12px 16px; border-bottom:1px solid var(--tg-grey-200); }
.tg-table th{ background:var(--tg-grey-50); color:var(--tg-grey-900); font-weight:700; }
.tg-table tr:last-child td{ border-bottom:none; }
.tg-table code{ background:var(--tg-grey-100); padding:2px 6px; border-radius:4px; font-size:.9em; }

.tg-steps{ counter-reset:tg-step; list-style:none; padding:0; margin:0; display:grid; gap:20px; }
.tg-steps li{ position:relative; padding-left:52px; }
.tg-steps li::before{
  counter-increment:tg-step; content:counter(tg-step);
  position:absolute; left:0; top:0; width:36px; height:36px; border-radius:50%;
  background:var(--tg-brand-light); color:var(--tg-brand-hover); font-weight:700;
  display:flex; align-items:center; justify-content:center;
}

/* ---------- Pricing ---------- */
.tg-pricing-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:24px; align-items:stretch; }
.tg-pricing-grid--single{ max-width:380px; margin:0 auto; grid-template-columns:1fr; }
.tg-price-card{
  background:#fff; border:1px solid var(--tg-grey-200); border-radius:var(--tg-radius);
  padding:32px; display:flex; flex-direction:column; box-shadow:var(--tg-shadow); position:relative;
}
.tg-price-card--popular{ border-color:var(--tg-brand); border-width:2px; }
.tg-price-ribbon{
  position:absolute; top:-13px; left:50%; transform:translateX(-50%);
  background:var(--tg-brand); color:#fff; font-size:.75rem; font-weight:700;
  padding:4px 14px; border-radius:999px; letter-spacing:.02em;
}
.tg-price-amount{ font-size:2.2rem; font-weight:700; color:var(--tg-grey-900); margin:10px 0 4px; }
.tg-price-amount span{ font-size:.95rem; color:var(--tg-grey-400); font-weight:600; }
.tg-price-card ul{ list-style:none; padding:0; margin:20px 0 28px; flex:1; }
.tg-price-card ul li{ padding:8px 0; border-top:1px solid var(--tg-grey-100); padding-left:26px; position:relative; }
.tg-price-card ul li:first-child{ border-top:none; }
.tg-price-card ul li::before{ content:"✓"; position:absolute; left:0; color:var(--tg-brand); font-weight:700; }

/* ---------- FAQ ---------- */
.tg-faq{ max-width:820px; margin:0 auto; }
.tg-faq details{
  background:#fff; border:1px solid var(--tg-grey-200); border-radius:var(--tg-radius-sm);
  padding:18px 22px; margin-bottom:12px;
}
.tg-faq summary{
  cursor:pointer; font-weight:700; color:var(--tg-grey-900); list-style:none;
  display:flex; justify-content:space-between; align-items:center; gap:12px;
}
.tg-faq summary::-webkit-details-marker{ display:none; }
.tg-faq summary::after{ content:"+"; font-size:1.3rem; color:var(--tg-brand); flex:none; }
.tg-faq details[open] summary::after{ content:"−"; }
.tg-faq details p{ margin-top:14px; color:var(--tg-grey-700); }

/* ---------- Generic content page (About / Contact / legal) ----------
 * Note: .tg-prose no longer caps its own width — it always sits on the
 * same element as .tg-container, so every page shares one standard
 * content width (the same one Features uses) instead of some pages
 * being narrower than others. */
.tg-prose h2{ margin-top:1.6em; }
.tg-prose ul{ margin-bottom:1.2em; }

/* ---------- CTA banner ---------- */
.tg-cta-banner{
  text-align:center; padding:56px 32px; border-radius:var(--tg-radius);
  background:linear-gradient(135deg,#1a7a4c,#0d5132); color:#fff;
}
.tg-cta-banner h2{ color:#fff; }

/* ---------- Footer ---------- */
.tg-footer{ background:var(--tg-grey-50); border-top:1px solid var(--tg-grey-200); padding-top:56px; }
.tg-footer-grid{ display:grid; grid-template-columns:2fr repeat(3,1fr); gap:32px; padding-bottom:40px; }
.tg-footer-grid h4{ font-size:.85rem; text-transform:uppercase; letter-spacing:.04em; color:var(--tg-grey-400); margin-bottom:14px; }
.tg-footer-grid ul{ list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.tg-footer-grid ul a{ color:var(--tg-grey-700); }
.tg-footer-about p{ color:var(--tg-grey-400); max-width:320px; }
.tg-footer-bottom{
  border-top:1px solid var(--tg-grey-200); padding:20px 0; display:flex; justify-content:space-between;
  align-items:center; flex-wrap:wrap; gap:12px; color:var(--tg-grey-400); font-size:.88rem;
}
.tg-footer-bottom a{ color:var(--tg-grey-400); }
@media (max-width:760px){ .tg-footer-grid{ grid-template-columns:1fr 1fr; } }

/* ---------- Scroll-reveal ---------- */
.tg-reveal{
  opacity:0; transform:translateY(18px);
  transition:opacity .55s ease, transform .55s ease;
}
.tg-reveal.is-visible{ opacity:1; transform:translateY(0); }
@media (prefers-reduced-motion:reduce){
  .tg-reveal{ opacity:1; transform:none; transition:none; }
}

/* ---------- Stat counters ---------- */
.tg-stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:20px; }
.tg-stat-card{
  background:#fff; border:1px solid var(--tg-grey-200); border-radius:var(--tg-radius);
  padding:28px 20px; text-align:center; box-shadow:var(--tg-shadow);
  border-top:3px solid var(--tg-brand); position:relative; overflow:hidden;
}
.tg-stat-icon{ width:34px; height:34px; margin:0 auto 12px; color:var(--tg-brand); }
.tg-stat-icon svg{ width:100%; height:100%; }
.tg-stat-number{
  font-size:clamp(2rem,4vw,2.6rem); font-weight:700; color:var(--tg-grey-900);
  font-variant-numeric:tabular-nums; line-height:1.1;
}
.tg-stat-label{ color:var(--tg-grey-400); font-size:.9rem; margin-top:6px; }

/* ---------- Copy-to-clipboard button ---------- */
.tg-copy-btn{
  display:inline-flex; align-items:center; gap:6px; font-size:.78rem; font-weight:600;
  color:var(--tg-brand-hover); background:var(--tg-brand-light); border:none; border-radius:999px;
  padding:4px 10px; cursor:pointer; transition:background .15s ease; white-space:nowrap;
}
.tg-copy-btn:hover{ background:#d5f0e3; }
.tg-copy-btn.is-copied{ background:var(--tg-brand); color:#fff; }
.tg-table td .tg-copy-btn{ margin-left:8px; }

/* ---------- Back to top ---------- */
.tg-back-to-top{
  position:fixed; right:22px; bottom:22px; z-index:60; width:46px; height:46px; border-radius:50%;
  background:var(--tg-brand); color:#fff; border:none; cursor:pointer; box-shadow:var(--tg-shadow);
  display:flex; align-items:center; justify-content:center;
  opacity:0; visibility:hidden; transform:translateY(10px);
  transition:opacity .2s ease, transform .2s ease, visibility .2s ease, background .15s ease;
}
.tg-back-to-top:hover{ background:var(--tg-brand-hover); }
.tg-back-to-top.is-visible{ opacity:1; visibility:visible; transform:translateY(0); }
.tg-back-to-top svg{ width:18px; height:18px; }

/* ==========================================================================
 * Service Portal specific
 * ========================================================================== */

/* ---------- Header account/login state ---------- */
.tg-header-account{ display:flex; align-items:center; gap:10px; }
.tg-header-account a{ color:var(--tg-grey-700); font-weight:600; font-size:.9rem; }
.tg-header-account a:hover{ color:var(--tg-brand); }
.tg-header-account .tg-avatar{
  width:30px; height:30px; border-radius:50%; background:var(--tg-brand-light); color:var(--tg-brand-hover);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.85rem; flex:none;
}

/* ---------- Portal welcome hero ---------- */
.tg-portal-hero{ text-align:center; }
.tg-portal-hero h1{ white-space:nowrap; }
@media (max-width:640px){ .tg-portal-hero h1{ white-space:normal; } }
.tg-portal-hero .tg-eyebrow{ margin-bottom:16px; }

/* ---------- Home layout: 25% quick links / 75% categories ---------- */
.tg-portal-columns{ display:grid; grid-template-columns:1fr 3fr; gap:32px; align-items:start; }
.tg-portal-col-quicklinks{ display:flex; flex-direction:column; gap:16px; }
@media (max-width:900px){
  .tg-portal-columns{ grid-template-columns:1fr; }
}

/* ---------- Quick-link cards ---------- */
.tg-quicklinks{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:22px; }
.tg-quicklink{
  display:block; background:#fff; border:1px solid var(--tg-grey-200); border-radius:var(--tg-radius);
  padding:28px; box-shadow:var(--tg-shadow); text-align:center; transition:transform .15s ease, box-shadow .15s ease;
  color:inherit; text-decoration:none;
}
.tg-quicklink:hover{ transform:translateY(-3px); box-shadow:0 6px 20px rgba(23,43,77,.1); color:inherit; }
.tg-quicklink .btn{ pointer-events:none; }
.tg-quicklink .tg-icon-badge{ margin:0 auto 16px; }
.tg-quicklink h3{ margin-bottom:6px; }
.tg-quicklink p{ color:var(--tg-grey-400); font-size:.92rem; margin-bottom:16px; }

/* Stacked variant used in the narrow left-hand column: icon + name only,
   in a single compact row. */
.tg-quicklink--stacked{
  display:flex; align-items:center; gap:14px; text-align:left; padding:16px 20px;
}
.tg-quicklink--stacked .tg-icon-badge{ margin:0; flex:none; width:40px; height:40px; }
.tg-quicklink--stacked h3{ margin:0; font-size:1rem; }

/* ---------- Portal shortcode pages (Open a Ticket / My Tickets / Knowledge Base) ---------- */
