/* ==========================================================
   TAPPITRACK — SHARED INNER-PAGE SECTIONS
   Used by every page except the homepage. Class prefix: pg-
   Hero, in-page nav, feature grid, split, steps, tiles, FAQ,
   related links, CTA band, forms and product detail.
   Colours: brand blue, red, dark text, white and neutral greys only.
   ========================================================== */

/* ---------- Hero panel ----------
   Every inner page opens with a rounded colour panel: copy on the left,
   a framed screenshot or photo on the right (optional floating card).
   Tone classes pick a muted shade of the brand blue family from
   main.css; white text stays above WCAG AA contrast on all of them.
   The breadcrumb trail is not shown; BreadcrumbList structured data in
   each page's <head> gives search engines the page path. */

.pg-hero {
    padding-top: 24px;
}

.pg-hero-panel {
    --tone: var(--tt-tone-ocean);

    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(28px, 4vw, 56px);
    padding: clamp(28px, 3.6vw, 48px) clamp(24px, 4.4vw, 64px);
    overflow: hidden;
    color: var(--tt-white);
    background: var(--tone);
    border-radius: 28px;
}

.pg-hero-panel--ocean { --tone: var(--tt-tone-ocean); }
.pg-hero-panel--steel { --tone: var(--tt-tone-steel); }
.pg-hero-panel--slate { --tone: var(--tt-tone-slate); }
.pg-hero-panel--teal { --tone: var(--tt-tone-teal); }
.pg-hero-panel--indigo { --tone: var(--tt-tone-indigo); }

/* Panels without a visual: one column, narrower copy. */
.pg-hero-panel--plain {
    grid-template-columns: minmax(0, 1fr);
}

.pg-hero-panel--plain .pg-hero-copy {
    max-width: 780px;
}

.pg-hero h1 {
    margin: 0 0 16px;
    color: var(--tt-white);
    font-size: clamp(32px, 3.6vw, 48px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.pg-lead {
    max-width: 620px;
    margin: 0 0 24px;
    font-size: clamp(16px, 1.25vw, 18px);
    line-height: 1.6;
    opacity: 0.92;
}

.pg-hero .btn-primary {
    color: var(--tone, var(--tt-blue));
    background: var(--tt-white);
}

.pg-hero .btn-primary:hover {
    background: var(--tt-blue-soft);
}

.pg-hero .btn-outline,
.pg-hero .btn-light {
    color: var(--tt-white);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.6);
}

.pg-hero .btn-outline:hover,
.pg-hero .btn-light:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--tt-white);
}

.pg-hero-visual {
    position: relative;
    isolation: isolate;
    padding-bottom: 8px;
}

/* Layered blocks behind the framed visual. */
.pg-hero-visual::before,
.pg-hero-visual::after {
    content: "";
    position: absolute;
    z-index: -1;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 22px;
}

.pg-hero-visual::before {
    top: -20px;
    left: 18%;
    width: 60%;
    height: 60px;
}

.pg-hero-visual::after {
    right: -24px;
    bottom: 12%;
    width: 40px;
    height: 70%;
}

.pg-hero-media {
    max-width: 560px;
    margin: 0 0 0 auto;
    overflow: hidden;
    background: var(--tt-white);
    border: 8px solid var(--tt-white);
    border-radius: 22px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.22);
    animation: pg-float 6s ease-in-out infinite alternate;
}

.pg-hero-media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 14px;
}

.pg-hero-card {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: min(300px, 75%);
    padding: 18px 20px;
    color: var(--tt-text);
    background: var(--tt-white);
    border-radius: var(--tt-radius);
    box-shadow: var(--tt-shadow);
}

.pg-hero-card strong {
    display: block;
    margin-bottom: 12px;
    color: var(--tt-dark);
    font-family: var(--tt-font-heading);
    font-size: 15px;
}

.pg-hero-card .pg-checks {
    gap: 8px;
    font-size: 13.5px;
}

@keyframes pg-float {
    to { translate: 0 -10px; }
}

.pg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pg-actions--spaced {
    margin-top: 28px;
}

/* ---------- In-page navigation ---------- */

.pg-subnav {
    position: sticky;
    top: var(--tt-header-height);
    z-index: 50;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--tt-border);
    backdrop-filter: blur(8px);
}

.pg-subnav ul {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 8px 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
}

.pg-subnav ul::-webkit-scrollbar {
    display: none;
}

.pg-subnav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    color: var(--tt-text);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease;
}

.pg-subnav a:hover {
    color: var(--tt-blue);
    background: var(--tt-blue-soft);
}

/* ---------- Sections ---------- */

.pg-section {
    padding-block: clamp(64px, 8vw, 112px);
    scroll-margin-top: calc(var(--tt-header-height) + 60px);
}

.pg-section--alt {
    background: var(--tt-light);
}

.pg-heading {
    max-width: 780px;
    margin-bottom: clamp(32px, 4vw, 56px);
}

.pg-heading--center {
    margin-inline: auto;
    text-align: center;
}

.pg-heading h2,
.pg-split h2 {
    margin: 14px 0 16px;
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 800;
    letter-spacing: -0.015em;
}

.pg-heading p,
.pg-split-copy > p {
    margin: 0;
    color: var(--tt-muted);
    font-size: 17px;
    line-height: 1.7;
}

/* ---------- Checklist ---------- */

.pg-checks {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg-checks li {
    position: relative;
    padding-left: 32px;
    line-height: 1.5;
}

.pg-checks li::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 0;
    width: 22px;
    height: 22px;
    background: var(--tt-blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230067EE' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
    border-radius: 50%;
}

/* ---------- Feature grid ---------- */

.pg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pg-card {
    padding: 28px;
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.pg-card:hover {
    border-color: var(--tt-blue);
    box-shadow: var(--tt-shadow-sm);
    transform: translateY(-2px);
}

.pg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    color: var(--tt-blue);
    background: var(--tt-blue-soft);
    border-radius: 12px;
}

.pg-icon svg,
.pg-tile-body em svg,
.pg-related svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pg-card h3 {
    margin: 0 0 10px;
    font-size: 19px;
}

.pg-card p {
    margin: 0;
    color: var(--tt-muted);
    line-height: 1.65;
}

/* ---------- Split ---------- */

.pg-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(32px, 6vw, 88px);
}

.pg-split--reverse .pg-media {
    order: 2;
}

.pg-media {
    margin: 0;
    overflow: hidden;
    border-radius: var(--tt-radius-lg);
    box-shadow: var(--tt-shadow);
}

.pg-media img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.pg-split .pg-checks {
    margin-top: 28px;
}

/* ---------- Steps ---------- */

.pg-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.pg-steps li {
    padding: 28px 24px;
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-top: 3px solid var(--tt-blue);
    border-radius: var(--tt-radius);
    counter-increment: step;
}

.pg-steps li::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    margin-bottom: 16px;
    color: var(--tt-red);
    font-family: var(--tt-font-heading);
    font-size: 28px;
    font-weight: 800;
}

.pg-steps h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.pg-steps p {
    margin: 0;
    color: var(--tt-muted);
    line-height: 1.6;
}

/* ---------- Image tiles (industries, solutions) ---------- */

.pg-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg-tile {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    color: inherit;
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    text-decoration: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.pg-tile:hover {
    border-color: var(--tt-blue);
    box-shadow: var(--tt-shadow-sm);
}

.pg-tile img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 500ms var(--tt-ease);
}

.pg-tile:hover img {
    transform: scale(1.04);
}

.pg-tile-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px 24px;
}

.pg-tile-body strong {
    color: var(--tt-dark);
    font-family: var(--tt-font-heading);
    font-size: 19px;
}

.pg-tile-body span {
    color: var(--tt-muted);
    line-height: 1.6;
}

.pg-tile-body em {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    color: var(--tt-blue);
    font-style: normal;
    font-weight: 700;
}

/* ---------- FAQ ---------- */

.pg-faq {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(32px, 6vw, 88px);
}

.pg-faq-list {
    border-top: 1px solid var(--tt-border);
}

.pg-faq-list details {
    border-bottom: 1px solid var(--tt-border);
}

.pg-faq-list summary {
    position: relative;
    padding: 22px 40px 22px 0;
    color: var(--tt-dark);
    font-family: var(--tt-font-heading);
    font-size: 18px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

.pg-faq-list summary::-webkit-details-marker {
    display: none;
}

.pg-faq-list summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 4px;
    color: var(--tt-blue);
    font-size: 24px;
    font-weight: 500;
    transform: translateY(-50%);
    transition: transform 200ms ease;
}

.pg-faq-list details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.pg-faq-list details p {
    margin: 0 0 22px;
    color: var(--tt-muted);
    line-height: 1.7;
}

/* ---------- Related links ---------- */

.pg-related {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.pg-related a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    color: var(--tt-dark);
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    font-weight: 700;
    text-decoration: none;
    transition: border-color 200ms ease, color 200ms ease;
}

.pg-tile-body em svg,
.pg-related svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--tt-blue);
    transition: transform 200ms ease;
}

.pg-tile:hover em svg,
.pg-related a:hover svg {
    transform: translateX(3px);
}

.pg-related a:hover {
    color: var(--tt-blue);
    border-color: var(--tt-blue);
}

/* ---------- CTA band ---------- */

.pg-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(28px, 4vw, 48px);
    color: var(--tt-white);
    background: var(--tt-blue);
    border-radius: var(--tt-radius-lg);
}

.pg-band h2 {
    margin: 0 0 8px;
    color: var(--tt-white);
    font-size: clamp(24px, 2.6vw, 32px);
}

.pg-band p {
    max-width: 640px;
    margin: 0;
    opacity: 0.92;
    line-height: 1.65;
}

.pg-band .btn-primary {
    color: var(--tt-blue);
    background: var(--tt-white);
}

.pg-band .btn-primary:hover {
    background: var(--tt-blue-soft);
}

.pg-band .pg-actions {
    flex: 0 1 620px;
    align-items: center;
    justify-content: flex-end;
}

/* ---------- Prose ---------- */

.pg-prose {
    max-width: 760px;
}

.pg-prose h2 {
    margin: 40px 0 14px;
    font-size: clamp(24px, 2.4vw, 30px);
}

.pg-prose p,
.pg-prose li {
    color: var(--tt-text);
    font-size: 17px;
    line-height: 1.75;
}

/* ---------- Contact and forms ---------- */

.pg-contact {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(32px, 6vw, 80px);
    align-items: start;
}

.pg-contact-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg-contact-list a,
.pg-contact-list div {
    display: flex;
    gap: 16px;
    padding: 20px;
    color: inherit;
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    text-decoration: none;
}

.pg-contact-list a:hover {
    border-color: var(--tt-blue);
}

.pg-contact-list .pg-icon {
    flex: 0 0 auto;
    margin: 0;
}

.pg-contact-list strong {
    display: block;
    color: var(--tt-dark);
}

.pg-contact-list span {
    color: var(--tt-muted);
}

.pg-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    max-width: 600px;
    padding: clamp(18px, 3vw, 24px);
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    box-shadow: var(--tt-shadow-sm);
}

.pg-form h2 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 19px;
}

.pg-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.pg-field--full,
.pg-form .btn,
.pg-form .pg-consent {
    grid-column: 1 / -1;
}

.pg-field label {
    color: var(--tt-dark);
    font-size: 13px;
    font-weight: 600;
}

.pg-field input,
.pg-field select,
.pg-field textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    color: var(--tt-dark);
    background: var(--tt-white);
    border: 1px solid #C9D5E3;
    border-radius: var(--tt-radius-sm);
    font-size: 15px;
}

.pg-field textarea {
    height: auto;
    min-height: 84px;
    padding: 10px 12px;
    resize: vertical;
}

.pg-field input:focus,
.pg-field select:focus,
.pg-field textarea:focus {
    border-color: var(--tt-blue);
    outline: 3px solid rgba(0, 103, 238, 0.16);
    outline-offset: 0;
}

.pg-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--tt-text);
    font-size: 13px;
    line-height: 1.45;
}

.pg-consent input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
}

.pg-form .btn {
    justify-self: start;
    min-width: 180px;
}

/* Form result messages, shown when the handler redirects to #sent or #error. */
.pg-notice {
    display: none;
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--tt-radius-sm);
    font-weight: 600;
}

.pg-notice:target {
    display: block;
}

.pg-notice--ok {
    color: var(--tt-blue);
    background: var(--tt-blue-soft);
}

.pg-notice--error {
    color: var(--tt-red);
    background: #FFF0F1;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .pg-hero-panel,
    .pg-split,
    .pg-faq,
    .pg-contact {
        grid-template-columns: minmax(0, 1fr);
    }

    .pg-hero-visual {
        max-width: 620px;
    }

    .pg-split--reverse .pg-media {
        order: 0;
    }

    .pg-grid,
    .pg-grid--4,
    .pg-tiles,
    .pg-steps,
    .pg-related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 640px) {
    .pg-actions .btn {
        flex: 1 1 100%;
    }

    .pg-hero {
        padding-top: 12px;
    }

    .pg-hero-panel {
        border-radius: 20px;
    }

    .pg-hero-visual::before,
    .pg-hero-visual::after {
        display: none;
    }

    .pg-hero-card {
        position: static;
        width: auto;
        margin-top: 16px;
    }

    .pg-grid,
    .pg-grid--4,
    .pg-tiles,
    .pg-steps,
    .pg-related {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Contact forms keep short fields in pairs on phones. */
    .pg-form {
        gap: 10px;
    }

    .pg-card,
    .pg-steps li {
        padding: 24px;
    }

    .pg-band .btn {
        flex: 1 1 100%;
    }

    .pg-form .btn {
        justify-self: stretch;
    }
}

@media (max-width: 359px) {
    .pg-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pg-hero-media {
        animation: none;
    }
}
