@import './tokens.css';
@import './base.css';
@import './layout.css';
@import './components/hero.css';
@import './components/accordion.css';
@import './components/framework-grid.css';
@import './components/pricing.css';
@import './components/testimonial.css';
@import './components/cmp.css';
@import './components/utilities.css';

/* Page-specific overrides for the post-CTA confirmation layout
   These are scoped under `.confirm-contents` to avoid changing global
   styles elsewhere. They adjust positioning, sizing and spacing only
   (no color values are changed). */
.confirm-contents {
    /* ensure content inherits the intended accent color without changing tokens */
    color: var(--color-accent-cream);
}

.confirm-contents .hero-title {
    position: static !important; /* use normal flow instead of absolute */
    margin: 0 auto 18px;
    text-align: center;
    color: var(--color-accent-cream) !important; /* use existing color token */
    font-size: 36px; /* match visual scale in Figma for mobile */
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 1; /* match other text color (no faint treatment) */
}

.confirm-contents .company-name {
    position: static !important; /* override global absolute placement */
    display: block !important;
    margin-top: 14px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: auto !important;
    text-align: center;
    font-size: var(--font-size-heading);
    font-weight: 700;
    line-height: 1.31884765625;
    color: var(--color-accent-cream) !important;
}

/* Center the OR separator between the CTA and the email details in the confirm block */
.confirm-contents .or-sep {
    display: block !important;
    width: 100% !important;
    /* balance spacing: CTA has 30px bottom, email-details has 18px top.
       Give OR 0 top and 12px bottom so: 30 + 0 == 12 + 18 */
    margin: 0 auto 12px !important;
    text-align: center !important;
}

/* Ensure logo image stacks above the company name */
.confirm-contents img.footer-logo-img {
    display: block !important;
    margin: 0 auto !important;
}

/* Ensure the CTA in the confirm block matches Figma sizing/vertical rhythm. */
.confirm-contents .announcement-access {
    width: 121px !important;
    height: 29px !important;
    font-size: 14px;
    line-height: 29px; /* vertically center text inside the button */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-family: var(--font-family);
    letter-spacing: 0.06em;
}

/* Slightly tighten paragraph spacing inside confirm contents to match Figma */
.confirm-contents p {
    margin-bottom: 12px;
}


/* Home page specific layout: center main footer content; pin links to bottom */
.home-page .footer {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.home-page .footer-content {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-page .footer-links {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

/* Home Intro (index) — vertically centered main content using the logo and badges */
.home-intro {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: var(--color-primary-dark);
}

.home-intro-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary-dark);
}

.home-intro-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-links {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-small);
    line-height: 18px;
    text-transform: uppercase;
    color: var(--color-accent-cream);
}

.home-intro .company-name {
    position: static;
    width: auto;
    height: auto;
    margin-top: 14px;
    font-size: var(--font-size-heading);
    font-weight: 700;
    line-height: 1.31884765625;
    text-align: center;
    color: var(--color-accent-cream);
}

/* Home badges replicate footer badge visuals without footer semantics */
.home-badges {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-badges .badge-group {
    position: static;
    width: 131.35px;
    height: 51.16px;
}

.home-badges .logo-badge {
    position: relative;
    width: 131.35px;
    height: 24.32px;
    top: 0;
}

.home-badges .logo-badge + .logo-badge {
    margin-top: 2.84px;
}

.home-badges .logo-badge:first-child,
.home-badges .logo-badge:last-child {
    top: 0;
}

.home-badges .badge-rect {
    width: 100%;
    height: 100%;
    border: 1px solid var(--color-accent-cream);
    background: transparent;
}

.home-badges .badge-text {
    position: absolute;
    top: 0.84px;
    left: 50%;
    transform: translateX(-50%);
    width: 113.76px;
    height: 21.81px;
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.31884765625;
    text-align: center;
    color: var(--color-accent-cream);
}

.home-link {
    color: var(--color-accent-cream);
    text-decoration: none;
}

.home-link:hover {
    text-decoration: underline;
}

.home-links .separator {
    color: var(--color-accent-cream);
}

/* Announcement styles have been moved to `announcement.css` for clarity.
   Import that file into the page where the announcement component is used. */
/* TODO: remove this comment once `announcement.css` is loaded separately */

/* Title Break Section */
.title-break {
    width: 100%;
    max-width: var(--container-mobile);
    margin: 0 auto;
    height: 95px;
    position: relative;
    background-color: var(--color-secondary);
    overflow: hidden;
    margin-top: -19px; /* Overlap hero image by 19px per Figma */
}

.title-break-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top center;
    background-color: var(--color-secondary);
}

/* Main Content */
.main-content {
    width: 100%;
    max-width: var(--container-mobile);
    margin: 0 auto;
    background-color: var(--color-secondary);
    position: relative;
}

/* Section Styles */
.section-title {
    font-size: var(--font-size-section);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-primary-text);
    margin-bottom: var(--space-4);
    padding: 0;
}

/* Align specific section titles with their content widths */
.debrief-section .section-title {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

.protocol-outline .section-title {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-4);
}

/* Protocol Outline Accordion */
.protocol-outline {
    position: relative;
    padding: var(--section-header-padding-top) var(--margin-page) var(--space-6);
}

/* accordion imported at top */

.protocol-outline .protocol-images {
    max-width: var(--content-max-width);
    margin: 0 auto var(--space-4);
}

.accordion {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0; /* stack items tightly without gaps */
}

.accordion-item {
    background: transparent;
    margin: 0;
}

/* Remove double borders between stacked headers */
.accordion-item + .accordion-item .accordion-header {
    border-top: 0;
}

.accordion-header {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    font: inherit;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid var(--color-primary-dark);
    color: var(--color-primary-dark);
    padding: var(--space-3) var(--space-4); /* add a bit more breathing room */
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 12px; /* ensure space between text and chevron */
    cursor: pointer;
    line-height: 1.2;
    min-height: 52px; /* slightly taller rows for better feel */
    transition: background-color var(--motion-fast) var(--easing-sharp),
        color var(--motion-fast) var(--easing-sharp),
        border-color var(--motion-fast) var(--easing-sharp),
        box-shadow var(--motion-fast) var(--easing-sharp);
}

/* When expanded, let the panel's top border serve as the separator */
.accordion-header[aria-expanded="true"] {
    border-bottom: 0;
}

.accordion-header:hover,
.accordion-header:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px var(--color-primary-dark), 0 0 0 1px transparent, 0 0 0 0 rgba(0,0,0,0);
    background: rgba(17, 17, 17, 0.03);
}

.accordion-title {
    font-size: var(--font-size-heading);
    font-weight: 700;
    line-height: 1.1;
    margin: 0; /* prevent default margins affecting height */
}

.accordion-chevron {
    width: 14px;
    height: 14px;
    border-right: 2px solid var(--color-primary-dark);
    border-bottom: 2px solid var(--color-primary-dark);
    transform: rotate(45deg);
    transition: transform var(--motion-fast) var(--easing-sharp);
    flex-shrink: 0;
}

.accordion-header[aria-expanded="true"] .accordion-chevron {
    transform: rotate(-135deg);
}

.accordion-panel {
    border-left: 1px solid var(--color-primary-dark);
    border-right: 1px solid var(--color-primary-dark);
    border-top: 1px solid var(--color-primary-dark);
    border-bottom: 1px solid var(--color-primary-dark);
    color: var(--color-primary-dark);
    overflow: hidden;
    height: auto;
    padding: var(--space-3);
    opacity: 1;
    transition: height var(--motion-fast) cubic-bezier(0.2, 0, 0, 1),
        opacity var(--motion-fast) cubic-bezier(0.2, 0, 0, 1);
    will-change: height, opacity;
    contain: layout paint;
    overflow-anchor: none;
}

/* Ensure list bullets inside accordion panels are fully visible and nicely spaced */
.accordion-panel ul {
    list-style: disc inside;
    margin: var(--space-2) 0 var(--space-3);
    padding-left: 8px; /* keeps bullets from hugging the border */
}

.accordion-panel li {
    margin-bottom: var(--space-1);
}

.accordion-panel.is-collapsing,
.accordion-panel.is-expanding {
    overflow: hidden;
}

.accordion-panel[hidden] {
    display: none !important;
}

.accordion-panel .panel-inner {
    opacity: 1;
    transform-origin: top;
    transform: scaleY(0.98) translateZ(0);
    transition: opacity var(--motion-fast) cubic-bezier(0.2, 0, 0, 1),
        transform var(--motion-fast) cubic-bezier(0.2, 0, 0, 1);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Final state for visible panel content */
.accordion-panel:not([hidden]) .panel-inner {
    transform: scaleY(1) translateZ(0);
}

.accordion-panel.is-collapsing .panel-inner,
.accordion-panel.is-expanding .panel-inner {
    will-change: transform, opacity;
}

/* Prevent re-entrancy during transitions for smoother animation */
.accordion-panel.is-collapsing,
.accordion-panel.is-expanding {
    pointer-events: none;
}

.access-section .section-title {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-4);
}

.faq-section .section-title {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-4);
}

.section-intro {
    font-size: 18px;
    font-weight: 400;
    font-style: italic;
    line-height: 1.25;
    color: var(--color-light);
    margin-bottom: var(--section-header-gap-to-grid);
    padding: 0;
}

.section-divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-primary-dark);
    margin: 20px 0;
}

/* Edge-to-edge divider that spans full viewport width and hugs section edges */
.edge-divider {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: 100vw;
    height: 1px;
    background-color: var(--color-primary-dark);
}

.edge-divider.bottom {
    top: auto;
    bottom: 0;
}

/* Debrief Section */
.debrief-section {
    position: relative;
    padding: var(--section-header-padding-top) var(--margin-page) var(--space-6);
}

.debrief-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.debrief-content p {
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.375;
    color: var(--color-primary-dark);
    margin-bottom: 20px;
}

/* Drives of Failure Section */
.drives-failure {
    position: relative;
    width: 100%;
    background-color: var(--color-primary-dark);
    /* Apply symmetric side padding at the section level to mirror other sections */
    padding: var(--section-header-padding-top) var(--margin-page) var(--space-6);
}

.drives-failure .section-content {
    padding: 0;
}

/* Align the Drives intro with the first column and control spacing */
.drives-failure .section-intro {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--section-header-gap-to-grid); /* standardized gap before framework grid */
    padding-left: 0;
    padding-right: 0;
    text-align: left;
}

/* framework-grid imported at top */

/* Apex Framework Section */
.apex-framework {
    position: relative; /* enable local positioning for edge divider */
    padding: var(--section-header-padding-top) var(--margin-page);
    background-color: var(--color-secondary);
}

.framework-intro {
    max-width: var(--content-max-width);
    margin: 0 auto 40px;
    padding-left: 0;
    padding-right: 0;
}

.framework-intro p {
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.375;
    color: var(--color-primary-text);
    margin-bottom: 20px;
}

.apex-framework > p {
    max-width: var(--content-max-width);
    margin: 0 auto 40px;
    padding-left: 0;
    padding-right: 0;
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.375;
    color: var(--color-primary-text);
}

.framework-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-primary-text);
    margin: var(--space-5) 0 var(--section-header-gap-to-grid);
    padding-left: 0;
    padding-right: 0;
}

/* Align the Apex framework title with the first column/grid content */
.apex-framework .framework-title {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}

/* Ensure Apex grid aligns with its title/content block */
.apex-framework .framework-grid {
    margin-left: auto;
    margin-right: auto;
}

/* Increase logo/icon size by 20% for the third row in Apex Framework */
.apex-framework .framework-grid .framework-row:nth-of-type(3) .icon-container.solution-icon.medium {
    width: calc(var(--icon-medium) * 1.2);
    height: calc(var(--icon-medium) * 1.2);
}

/* Protocol Outline Section */
.protocol-outline {
    position: relative;
    padding: var(--section-header-padding-top) var(--margin-page) var(--space-6);
    background-color: var(--color-secondary);
}

.protocol-images {
    margin: 40px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.protocol-image {
    width: 267.28px;
    height: 188.91px;
    background-color: var(--color-muted);
    border: 0.1px solid var(--color-primary-dark);
}

/* static image placeholder; if you add a background-image, it will fill */

.protocol-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.protocol-content h3 {
    font-size: var(--font-size-body);
    font-weight: 700;
    color: var(--color-primary-text);
    margin: var(--space-5) 0 var(--space-2);
}

.protocol-content p {
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-primary-text);
    margin-bottom: var(--space-2);
}

.protocol-content ul {
    margin: var(--space-2) 0 var(--space-4) 20px;
}

.protocol-content li {
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-primary-text);
    margin-bottom: var(--space-1);
}

/* Testimonial Section */
/* testimonial imported at top */

/* Access Section */
/* pricing imported at top */

/* CTA Buttons */
.cta-button-container {
    display: flex;
    justify-content: center;
    /* Bring button closer to the copy per Figma */
    margin: 14px 0;
}

.cta-button {
    width: var(--button-width);
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* no subtitle note below button */
}

.button-rect {
    width: 122px;
    height: var(--button-height);
    margin: 0 auto;
    background-color: var(--color-primary-text);
    border: 1px solid var(--color-primary-text);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px; /* allow wrapping with side padding */
}

.enterprise-button .button-rect {
    border: 1px solid var(--color-primary-text);
}

.button-text {
    position: static;
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
    color: var(--color-light);
    white-space: normal;
    overflow-wrap: anywhere;
}

.enterprise-button .button-text {
    color: var(--color-accent-cream);
}

.button-note {
    position: static;
    width: 100%;
    font-size: var(--font-size-small);
    font-weight: 700;
    line-height: 1.5714285714285714;
    text-align: center;
    color: var(--color-primary-text);
    text-decoration: underline;
}

/* Disclaimer */
.disclaimer {
    /* Align disclaimer spacing with section header rhythm */
    margin-top: var(--section-header-padding-top);
    padding: 20px 0;
}

.disclaimer p {
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.375;
    color: var(--color-primary-dark);
    text-align: left;
}

/* FAQ Section */
.faq-section {
    position: relative;
    padding: var(--section-header-padding-top) var(--margin-content) var(--space-6);
    max-width: var(--container-mobile);
    margin: 0 auto;
    background-color: var(--color-secondary);
}

.faq-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 30px;
}

.faq-item h3 {
    font-size: var(--font-size-body);
    font-weight: 700;
    line-height: 1.375;
    color: var(--color-primary-text);
    margin-bottom: 10px;
}

.faq-item p {
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.375;
    color: var(--color-primary-text);
}

/* Footer */
.footer {
    width: 100%;
    height: 150px;
    position: relative;
    background-color: var(--color-primary-dark);
}

.footer-background {
    width: 100%;
    height: 100%;
    background-color: var(--color-primary-dark);
}

.footer-logo {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 110.3px;
    height: 89.16px;
}

.footer .logo-badges {
    position: absolute;
    top: 38px;
    left: 1px;
    width: 109.06px;
    height: 51.16px;
    filter: drop-shadow(0px 4px 4px rgba(255, 255, 255, 0.1));
}

/* Footer stack: logo -> 14px -> AXIOM -> 18px -> links */
.footer-content {
    position: absolute;
    top: 50%; /* center vertically within 150px footer */
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo-img {
    display: block;
    width: 79px;
    height: 30px;
}

.footer .company-name {
    position: static; /* override global absolute positioning */
    width: auto;
    height: auto;
    margin-top: 14px; /* 14px above AXIOM per spec */
    font-size: var(--font-size-heading);
    font-weight: 700;
    line-height: 1.31884765625;
    text-align: center;
    color: var(--color-accent-cream);
}

/* Footer Links (Figma node 29:172) */
.footer-badges {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reuse landing header badge structure and dimensions */
.footer-badges .badge-group {
    position: static;
    width: 131.35px;
    height: 51.16px;
}

.footer-badges .logo-badge {
    position: relative;
    width: 131.35px;
    height: 24.32px;
    top: 0; /* reset any inherited offset */
}

.footer-badges .logo-badge + .logo-badge {
    margin-top: 2.84px; /* vertical gap between stacked badges */
}

/* Ensure global first/last-child offsets don't apply in footer */
.footer-badges .logo-badge:first-child,
.footer-badges .logo-badge:last-child {
    top: 0;
}

.footer-badges .badge-rect {
    width: 100%;
    height: 100%;
    border: 1px solid var(--color-accent-cream);
    background: transparent;
}

.footer-badges .badge-text {
    position: absolute;
    top: 0.84px;
    left: 50%;
    transform: translateX(-50%);
    width: 113.76px; /* header variant width */
    height: 21.81px;
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: 1.31884765625;
    text-align: center;
    color: var(--color-accent-cream);
}

.footer-links {
    margin-top: 18px; /* 18px below AXIOM per spec */
    display: flex;
    align-items: center;
    gap: 8px; /* space around the slash */
    font-size: var(--font-size-small); /* 14px */
    line-height: 18px; /* Figma leading */
    text-transform: uppercase;
    color: var(--color-accent-cream);
}

.footer-link {
    color: var(--color-accent-cream);
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer .separator {
    color: var(--color-accent-cream);
}

/* Hover Effects */
.cta-button:hover .button-rect {
    background-color: var(--color-light);
}

.cta-button:hover .button-text {
    color: var(--color-primary-dark);
}

.cta-button:active {
    transform: translateY(1px);
}

/* Responsive Design - Tablet */
@media (min-width: 768px) {
    body {
        max-width: var(--container-mobile);
    }
    
    .framework-row {
        justify-content: center;
        gap: 40px;
    }
    
    .framework-card {
        width: 240px;
    }
    
    .pricing-container {
        display: flex;
        gap: 40px;
        max-width: 800px;
        align-items: flex-start;
    }
    
    .pricing-card {
        flex: 1;
        margin-bottom: 0;
    }
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    body {
        max-width: var(--container-mobile);
    }
    
    .section-title,
    .debrief-section,
    .apex-framework,
    .protocol-outline,
    .access-section,
    .faq-section {
        padding-left: 60px;
        padding-right: 60px;
    }
    
    /* show expand/collapse control on desktop */
    .accordion-controls {
        display: flex;
        justify-content: flex-end;
    }
    
    .framework-grid {
        max-width: 800px;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .testimonial-content {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Desktop announcement overrides moved to `announcement.css` */
}