/*
 * Free website audit page and its confirmation landing.
 * Self-contained (contact.css is not loaded here), but every component copies the contact page:
 * wrapper padding, Syne type, the underline inputs with uppercase placeholder-labels, and the
 * dark CTA box that turns red on hover with the site-wide two-arrow animation (main.css .arrow).
 */

.free-audit {
    padding: 30px var(--site-gutter) 60px;
}

.free-audit--confirmed {
    min-height: 55vh;
}

.free-audit h1 {
    font-family: 'SyneBold', sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 9vw, 64px);
    line-height: 1;
    letter-spacing: -0.03em;
    margin: 0 0 20px;
}

.free-audit-lead {
    max-width: 44rem;
    font-size: 18px;
    line-height: 1.5;
    margin: 0 0 10px;
}

.free-audit a:not(.button-submit) {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Live progress on the confirmation landing. */
.free-audit-progress {
    max-width: 44rem;
    margin-top: 40px;
}

.free-audit .free-audit-progress-title,
.free-audit .free-audit-meanwhile-title,
.free-audit .free-audit-progress-close {
    transform: none;
}

.free-audit-progress-title,
.free-audit-meanwhile-title {
    font-family: 'SyneBold', sans-serif;
    font-size: 22px;
    line-height: 1.2;
    margin: 0 0 20px;
}

.free-audit-progress-now {
    display: grid;
    gap: 4px;
    margin-bottom: 24px;
}

.free-audit-progress-now-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cd1313;
}

.free-audit-progress-now-title {
    font-family: 'SyneBold', sans-serif;
    font-size: 22px;
    line-height: 1.25;
}

.free-audit-progress-now-why {
    font-size: 17px;
    line-height: 1.5;
    color: #444;
}

.free-audit-progress-track {
    height: 4px;
    background: #ececec;
    overflow: hidden;
}

.free-audit-progress-fill {
    height: 100%;
    background: #cd1313;
    transition: width 0.8s ease;
}

.free-audit-progress-fill.is-failed {
    background: #8a8a8a;
}

.free-audit-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #555;
}

.free-audit-progress-meta strong {
    color: #151515;
}

.free-audit-progress-steps {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.free-audit-progress-steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 17px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.free-audit-progress-steps li.is-done {
    color: #9a9a9a;
}

.free-audit-progress-steps li.is-current {
    color: #151515;
    font-family: 'SyneSemiBold', sans-serif;
}

.free-audit-progress-steps li.is-pending {
    color: #b8b8b8;
}

.free-audit-progress-steps li.is-failed {
    color: #151515;
}

.free-audit-progress-icon {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}

/* done: red tick */
.is-done > .free-audit-progress-icon::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid #cd1313;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* current: spinner */
.is-current > .free-audit-progress-icon::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 50%;
    border: 2px solid rgba(205, 19, 19, 0.2);
    border-top-color: #cd1313;
    animation: free-audit-spin 0.8s linear infinite;
}

/* pending: small dot */
.is-pending > .free-audit-progress-icon::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* failed: grey cross */
.is-failed > .free-audit-progress-icon::before,
.is-failed > .free-audit-progress-icon::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 2px;
    width: 2px;
    height: 14px;
    background: #8a8a8a;
    transform: rotate(45deg);
}

.is-failed > .free-audit-progress-icon::after {
    transform: rotate(-45deg);
}

@keyframes free-audit-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .is-current > .free-audit-progress-icon::before {
        animation: none;
        border-color: #cd1313;
    }

    .free-audit-progress-fill {
        transition: none;
    }
}

.free-audit-progress-result {
    display: grid;
    gap: 6px;
    margin-top: 28px;
    padding: 20px 24px;
    border-left: 4px solid #cd1313;
    background: #f4f4f4;
    font-size: 17px;
    line-height: 1.5;
}

.free-audit-progress-result strong {
    font-family: 'SyneBold', sans-serif;
    font-size: 20px;
}

.free-audit-progress-result.is-failed {
    border-left-color: #8a8a8a;
}

.free-audit-progress-result[hidden],
.free-audit-progress-now[hidden],
.free-audit-progress-close[hidden] {
    display: none;
}

.free-audit-progress-close {
    margin: 24px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: #555;
}

.free-audit-meanwhile {
    margin-top: 40px;
}

.free-audit-meanwhile ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    font-size: 17px;
}

/* Waiting-page tips. A plain list without JavaScript; free-audit-tips.js turns it into one rotating card. */
.free-audit-tips {
    max-width: 44rem;
}

/* Form page: the report preview sits below the form, and to its right from 1280px up. */
.free-audit-preview {
    margin: 50px 0 0;
    max-width: 36rem;
}

.free-audit-preview img {
    display: block;
    width: 100%;
    height: auto;
}

@media (min-width: 1280px) {
    .free-audit-split.free-audit-split--form {
        grid-template-columns: minmax(0, 46rem) minmax(0, 36rem);
        column-gap: clamp(48px, 6vw, 120px);
        align-items: start;
    }

    .free-audit-preview {
        margin-top: 0;
        padding-top: 40px;
    }
}

/* The intro keeps the width it had in the 8-column layout. */
.free-audit-intro {
    max-width: 58rem;
}

/* Progress and tips: stacked below 1280px, side by side above. No sticky: ScrollSmoother scrolls by transform. */
.free-audit-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1280px) {
    .free-audit-split {
        grid-template-columns: minmax(0, 44rem) minmax(0, 34rem);
        column-gap: clamp(48px, 6vw, 120px);
        align-items: start;
    }
}

.free-audit-tips-viewport {
    display: grid;
    gap: 16px;
}

.free-audit-tip {
    display: grid;
    gap: 8px;
    padding: 24px 26px;
    border-left: 4px solid #cd1313;
    background: #f4f4f4;
}

.free-audit-tip[hidden] {
    display: none;
}

.free-audit-tip-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cd1313;
}

.free-audit .free-audit-tip-title {
    font-family: 'SyneBold', sans-serif;
    font-size: 21px;
    line-height: 1.25;
    margin: 0;
    transform: none;
}

.free-audit .free-audit-tip-text {
    font-size: 17px;
    line-height: 1.55;
    color: #444;
    margin: 0;
    transform: none;
}

.free-audit-tips.is-carousel .free-audit-tip {
    min-height: 190px;
    align-content: start;
}

.free-audit-tips.is-carousel .free-audit-tip.is-active {
    animation: free-audit-tip-in 0.45s ease;
}

@keyframes free-audit-tip-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.free-audit-tips-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.free-audit-tips-controls[hidden] {
    display: none;
}

.free-audit-tips-button {
    width: 40px;
    height: 40px;
    border: 1px solid #cfcfcf;
    border-radius: 50%;
    background: #fff;
    color: #1a1a1a;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.free-audit-tips-button:hover,
.free-audit-tips-button:focus-visible {
    border-color: #cd1313;
    color: #cd1313;
}

.free-audit-tips-button:focus-visible {
    outline: 2px solid #cd1313;
    outline-offset: 2px;
}

.free-audit-tips-counter {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #555;
    min-width: 4.5em;
    text-align: center;
}

/* Time left before the next tip. */
.free-audit-tips-timer {
    flex: 1;
    height: 2px;
    background: #ececec;
    overflow: hidden;
}

.free-audit-tips-timer > span {
    display: block;
    height: 100%;
    width: 0;
    background: #cd1313;
}

.free-audit-tips-timer > span.is-running {
    animation-name: free-audit-tip-timer;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.free-audit-tips.is-paused .free-audit-tips-timer > span {
    animation-play-state: paused;
}

@keyframes free-audit-tip-timer {
    from { width: 0; }
    to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .free-audit-tips.is-carousel .free-audit-tip.is-active {
        animation: none;
    }

    .free-audit-tips-timer {
        display: none;
    }
}

@media (min-width: 1280px) {
    .free-audit .free-audit-tip-title {
        font-size: 26px;
    }

    .free-audit .free-audit-tip-text {
        font-size: 19px;
    }
}

/* The report's one-button call request. */
.free-audit-call-form .button-wrapper {
    margin-top: 30px;
}

.free-audit-call-done {
    max-width: 44rem;
    margin-top: 10px;
}

.free-audit-call-alt {
    margin: 40px 0 0;
    font-size: 16px;
    line-height: 1.5;
    color: #555;
}

/* Outcome messages (live region content). */
.free-audit-outcome {
    margin: 30px 0;
    padding: 20px 24px;
    border-left: 4px solid #cd1313;
    background: #f4f4f4;
    max-width: 44rem;
}

.free-audit-outcome-title {
    font-family: 'SyneBold', sans-serif;
    font-size: 28px;
    line-height: 1.1;
    margin: 0 0 10px;
}

/* Status and error text must show at once, not slide in with the site's paragraph reveal. */
.free-audit .free-audit-outcome p,
.free-audit .free-audit-outcome-title,
.free-audit .free-audit-disabled,
.free-audit .free-audit-error {
    transform: none;
}

.free-audit-outcome p,
.free-audit-disabled {
    font-size: 18px;
    line-height: 1.5;
    margin: 0;
}

/* Form: same inputs as the contact form (no visible label; the placeholder reads as the label). */
.free-audit-form {
    max-width: 44rem;
    margin-top: 30px;
}

.free-audit-field {
    margin-bottom: 30px;
}

.free-audit-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.free-audit-field .contact-input {
    display: block;
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    padding: 0;
    border: 0;
    border-bottom: 2px solid #8a8a8a;
    border-radius: 0;
    outline: none;
    background: transparent;
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    color: #000;
    transition: border-color 0.2s ease;
}

.free-audit-field .contact-input::placeholder {
    color: #151515;
    opacity: 1;
    font-size: 14px;
}

.free-audit-field .contact-input:focus {
    border-bottom-color: #151515;
}

.free-audit-field .contact-has-error {
    border-bottom-color: #cd1313;
}

.free-audit-field .contact-has-error::placeholder {
    color: #cd1313;
}

.free-audit-error {
    margin: 8px 0 0;
    color: #cd1313;
    font-size: 14px;
}

.free-audit-consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.free-audit-consent input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: #151515;
}

.free-audit-consent label {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.free-audit-privacy {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin: 0;
}

/* Honeypot: off-screen, never visible. */
.free-audit-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* CTA: identical to the contact form's "αποστολή" button. */
.free-audit .button-wrapper {
    display: flex;
    justify-content: flex-start;
    padding: 40px 0 0;
}

.free-audit .button-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: auto;
    padding: 14px 24px;
    border: none;
    background: #151515;
    color: #fdfdfd;
    font-family: 'SyneSemiBold', sans-serif;
    font-weight: 500;
    font-size: 18px;
    white-space: nowrap;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.free-audit .button-submit .arrow,
.free-audit .button-submit .arrow img {
    width: 20px;
    height: 20px;
}

.free-audit .button-submit .arrow img {
    filter: brightness(0) invert(1);
}

@media (hover: hover) {
    .free-audit .button-submit:hover {
        background: #cd1313;
        color: #fdfdfd;
    }
}

.free-audit .button-submit:focus-visible {
    outline: 2px solid #151515;
    outline-offset: 4px;
}

/* CMS "what we check" content */
.free-audit-checks {
    margin-top: 60px;
    max-width: 44rem;
    font-size: 18px;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .free-audit {
        padding: 50px var(--site-gutter) 80px;
    }

    .free-audit h1 {
        font-size: clamp(56px, 7vw, 96px);
        margin-bottom: 30px;
    }

    .free-audit-lead {
        font-size: 20px;
    }

    .free-audit-field .contact-input {
        font-size: 26px;
    }

    .free-audit-field .contact-input::placeholder {
        font-size: max(14px, min(18px, 1.82vw));
    }

    .free-audit .button-submit {
        padding: 18px 40px;
        font-size: 24px;
    }

    .free-audit .button-submit .arrow,
    .free-audit .button-submit .arrow img {
        width: 22px;
        height: 22px;
    }
}

@media (min-width: 1280px) {
    .free-audit {
        padding: 100px var(--site-gutter) 100px;
    }

    .free-audit h1 {
        font-size: clamp(80px, 7vw, 120px);
    }

    .free-audit-lead {
        font-size: 24px;
    }

    .free-audit-progress-title,
    .free-audit-meanwhile-title {
        font-size: 28px;
    }

    .free-audit-progress-now-title {
        font-size: 28px;
    }

    .free-audit-progress-now-why,
    .free-audit-progress-steps li {
        font-size: 19px;
    }

    .free-audit-field .contact-input {
        font-size: 32px;
    }

    .free-audit-field .contact-input::placeholder {
        font-size: min(22px, 1.22vw);
    }

    .free-audit .button-wrapper {
        padding-top: 60px;
    }

    .free-audit .button-submit {
        padding: 20px 48px;
        font-size: 28px;
    }

    .free-audit .button-submit .arrow,
    .free-audit .button-submit .arrow img {
        width: 24px;
        height: 24px;
    }
}

/*
 * Progress page: the visitor came to watch the audit, so the page heading steps back (smaller, closer to
 * the header) and the hierarchy reads section title < current step. On a 1080p screen the progress and the
 * tips start in the first half of the screen.
 */
@media (min-width: 768px) {
    .free-audit--confirmed {
        padding-top: 32px;
    }

    .free-audit--confirmed h1 {
        font-size: clamp(40px, 5vw, 56px);
        margin-bottom: 12px;
    }

    .free-audit--confirmed .free-audit-lead {
        font-size: 18px;
    }
}

@media (min-width: 1280px) {
    .free-audit--confirmed {
        padding-top: 40px;
    }

    .free-audit--confirmed .free-audit-intro {
        max-width: none;
    }

    .free-audit--confirmed .free-audit-progress-title,
    .free-audit--confirmed .free-audit-meanwhile-title {
        font-size: 20px;
    }

    .free-audit--confirmed .free-audit-progress-now-title {
        font-size: 34px;
    }
}

.free-audit--confirmed .free-audit-progress,
.free-audit--confirmed .free-audit-meanwhile {
    margin-top: 28px;
}

.free-audit--confirmed .free-audit-progress-title,
.free-audit--confirmed .free-audit-meanwhile-title {
    color: #555;
    margin-bottom: 16px;
}

/*
 * Form page fits the first screen: on a 1080p screen (and 1280x800) the heading, both fields, the consent
 * and the submit button are visible without scrolling. The heading sets on two lines instead of three.
 */
@media (min-width: 1280px) {
    .free-audit:not(.free-audit--confirmed) {
        padding-top: 48px;
    }

    .free-audit:not(.free-audit--confirmed) h1 {
        font-size: clamp(60px, 4.6vw, 88px);
        margin-bottom: 8px;
        overflow-wrap: break-word;
        min-width: 0;
    }

    .free-audit-form {
        margin-top: 16px;
    }

    .free-audit-field {
        margin-bottom: 22px;
    }

    .free-audit:not(.free-audit--confirmed) .button-wrapper {
        padding-top: 28px;
    }

    .free-audit-split--form .free-audit-preview {
        padding-top: 8px;
    }
}

/*
 * Entry: the heading, the two fields and the report preview rise in once, in that order. Transform and
 * opacity only, CSS only (visible without JavaScript); paragraphs and the button keep the site's own GSAP
 * reveal. Off when the visitor prefers reduced motion.
 */
@keyframes free-audit-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@keyframes free-audit-settle {
    from { opacity: 0; transform: translateY(28px) rotate(2deg) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.free-audit:not(.free-audit--confirmed) h1,
.free-audit-form .free-audit-field {
    animation: free-audit-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.free-audit-form .free-audit-field:nth-of-type(1) { animation-delay: 0.12s; }
.free-audit-form .free-audit-field:nth-of-type(2) { animation-delay: 0.2s; }
.free-audit-form .free-audit-field:nth-of-type(3) { animation-delay: 0.28s; }

.free-audit-preview {
    animation: free-audit-settle 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both;
}

@media (prefers-reduced-motion: reduce) {
    .free-audit:not(.free-audit--confirmed) h1,
    .free-audit-form .free-audit-field,
    .free-audit-preview {
        animation: none;
    }
}

/*
 * Form page alignment: the form keeps the logo's left edge, the report preview takes the menu icon's right
 * edge, and both sit on one vertical centre, so the spare width goes between them instead of after the image.
 */
@media (min-width: 1280px) {
    .free-audit-split.free-audit-split--form {
        grid-template-columns: minmax(0, 46rem) minmax(0, 1fr);
        align-items: center;
    }

    .free-audit-split--form .free-audit-preview {
        justify-self: end;
        width: 100%;
        max-width: 38rem;
        padding-top: 0;
    }
}
