/* ============================================================
   PEZWEB — Contact Form
   Template: page-contacto.php
   ============================================================ */

/* Contact page shell — matches .archive-wrap document pages */
.pw-contact-wrap > .archive-header .pz-page-title {
    margin-bottom: var(--gap-md);
}

/* ─── Layout ─────────────────────────────────────────────────── */

.pw-contact {
    position: relative;
    min-height: 60svh;
    padding: 0 0 var(--section-pad-b, 8rem);
    overflow: hidden;
}

.pw-contact__workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-md);
    align-items: start;
}

.pw-contact__steps {
    position: relative;
    min-height: 60svh;
    min-width: 0;
    overflow: hidden;
}

/* ─── Stage head (question left, progress right) ─────────────── */

.pw-contact__stage-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-md);
    align-items: start;
}

.pw-contact__stage-question {
    min-width: 0;
}

.pw-contact__stage-head .pw-contact__question {
    font-size: 1.3rem;
    line-height: 1.9;
    margin: 0;
}

.pw-contact__stage-progress {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    width: 100%;
    padding-top: 0.35rem;
}

.pw-contact__stage-progress .pw-contact__card-progress {
    width: 100%;
    max-width: 100%;
}

.pw-contact__stage-head + .taxonomy-description__rule {
    margin: var(--gap-md) 0;
}

/* ─── Sidebar (feed, steps 2–6) ──────────────────────────────── */

.pw-contact__aside {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gap-md);
    min-width: 0;
    padding-top: 0.2rem;
    text-align: left;
}

.pw-contact--has-aside .pw-contact__aside {
    display: flex;
}

.pw-contact--success .pw-contact__aside {
    display: none;
}

.pw-contact__progress-label {
    flex-shrink: 0;
    font-size: 1rem;
    opacity: 0.35;
    letter-spacing: 0.06em;
    font-family: 'Roboto Mono', monospace, Helvetica, sans-serif;
    white-space: nowrap;
}

.pw-contact__progress-bar {
    flex: 1 1 auto;
    min-width: 4rem;
    height: 1px;
    background: #333333;
    position: relative;
}

.pw-contact__progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 20%;
    background: #ffffff;
    transition: width 0.4s ease;
}

.pw-contact__feed {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    font-family: 'Roboto', Helvetica, Verdana, Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 400;
    color: #6d6d6d;
    text-align: left;
    word-break: break-word;
    margin: 0;
    width: 100%;
    max-width: 100%;
}

.pw-contact__feed-line {
    display: block;
    line-height: 1.8;
}

.pw-contact__feed-line--error {
    color: #ffffff;
}

/* ─── Steps ──────────────────────────────────────────────────── */

.pw-contact__step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 60svh;
    padding-top: 0;
    padding-bottom: var(--gap-lg);
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ─── Step card (inputs + actions) ───────────────────────────── */

.pw-contact__card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
    width: 100%;
    max-width: 100%;
    padding: var(--gap-xs);
    border: 1px solid #1c1c1c;
    background: #0d0d0d;
}

.pw-contact__card-progress {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.2rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
}

.pw-contact__card-progress[hidden] {
    display: none;
}

.pw-contact__card .pw-contact__step-footer {
    box-sizing: border-box;
    width: calc(100% + 2 * var(--gap-xs));
    margin-left: calc(-1 * var(--gap-xs));
    margin-right: calc(-1 * var(--gap-xs));
}

.pw-contact__card .pw-contact__step-body {
    padding: 0;
    width: 100%;
}

.pw-contact__card .pw-contact__step-footer {
    align-self: stretch;
    max-width: none;
    padding: var(--gap-xs) var(--gap-xs) 0;
    margin-top: 0;
    margin-bottom: 0;
    border-top: 1px solid #1c1c1c;
}

.pw-contact__required-note {
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 400;
    color: #6d6d6d;
    opacity: 0.65;
}

.pw-contact__step-body {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
    width: 100%;
    max-width: 100%;
}

.pw-contact__step-footer {
    width: 100%;
    max-width: 100%;
}

.pw-contact__step--services .pw-contact__hint {
    max-width: none;
}

/* Question uses .single-post__meta.taxonomy-description from main.css */

.pw-contact__hint {
    font-size: 1.2rem;
    opacity: 0.4;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    max-width: 56rem;
}

/* ─── Language selector (step 1) ─────────────────────────────── */

.pw-contact__lang-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0;
}

.pw-contact__lang-btn.is-selected {
    background: #444444;
}

/* ─── Inputs ─────────────────────────────────────────────────── */

.pw-contact__fields {
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
    width: 100%;
    max-width: none;
}

@media (min-width: 640px) {
    .pw-contact__fields--split {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .pw-contact__fields--split .pw-contact__field {
        flex: 1 1 calc(50% - 0.6rem);
        min-width: 0;
    }
}

.pw-contact__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
}

.pw-contact__field--wide {
    flex: 1 1 100%;
    width: 100%;
}

.pw-contact__input-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.45;
    cursor: text;
}

.pw-contact__input {
    display: block;
    width: 100%;
    padding: 0.5rem 1.5rem;
    font-size: 1.1rem;
    font-family: 'Roboto', Helvetica, sans-serif;
    color: #fafafa;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.pw-contact__input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.pw-contact__input:focus {
    border-color: #878787;
    box-shadow: 0 0 0 2px rgba(135, 135, 135, 0.15);
}

.pw-contact__input--textarea {
    resize: vertical;
    min-height: 8rem;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ─── Actions (card footer) ──────────────────────────────────── */

.pw-contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0;
    align-items: center;
}

.pw-contact__back,
.pw-contact__next,
.pw-contact__submit {
    display: inline-block;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
    border: none;
    font-family: 'Roboto', Helvetica, sans-serif;
    transition: background 0.15s ease;
}

.pw-contact__back,
.pw-contact__next {
    background: #333333;
}

.pw-contact__submit {
    background: #dd0000;
}

.pw-contact__back:hover,
.pw-contact__next:hover {
    background: #444444;
    opacity: 1;
}

.pw-contact__submit:hover {
    background: #bb0000;
    opacity: 1;
}

.pw-contact__next:disabled,
.pw-contact__submit:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ─── Services list (step 4) — stacked sections, full width ─── */

.pw-contact__svc-list {
    width: 100%;
    max-width: none;
    max-height: 55svh;
    overflow-y: auto;
    padding-right: 0;
    scrollbar-width: thin;
    scrollbar-color: #333333 #1a1a1a;
}

.pw-contact__svc-stack {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
    width: 100%;
}

.pw-contact__svc-col {
    min-width: 0;
}

.pw-contact__svc-col .pz-section-title {
    margin-top: 0;
    text-align: left;
}

.pw-contact__svc-col-list {
    display: flex;
    flex-direction: column;
}

.pw-contact__svc-row {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    margin-bottom: 5px;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    background-color: #0f0f0f;
    transition: background-color 0.12s ease;
}

.pw-contact__svc-row::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: #fafafa;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
    pointer-events: none;
}

.pw-contact__svc-row .archive-title,
.pw-contact__svc-row .pw-contact__svc-parent {
    position: relative;
    z-index: 1;
}

.pw-contact__svc-row .archive-title {
    flex: 0 1 auto;
    min-width: 0;
    text-align: left;
}

.pw-contact__svc-parent {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6d6d6d;
    text-align: right;
}

.pw-contact__svc-row:hover:not(.is-checked) {
    background-color: #1a1a1a;
}

.pw-contact__svc-row.is-checked::after {
    transform: translateX(0);
}

.pw-contact__svc-row.is-checked:hover::after {
    background-color: #ffffff;
}

.pw-contact__svc-row.is-checked .archive-title {
    color: #fafafa;
}

.pw-contact__svc-row.is-checked .pw-contact__svc-parent {
    color: #0f0f0f;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .pw-contact__svc-row::after {
        transition: none;
    }
}

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

.pw-contact__input--invalid {
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

/* ─── Transmit terminal (step 5, while sending) ──────────────── */

.pw-contact__step--sending .pw-contact__card {
    display: none;
}

.pw-contact__step[data-step="6"] > .pw-contact__transmit {
    width: 100%;
    max-width: 100%;
}

.pw-contact__transmit {
    display: none;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
}

.pw-contact__step--sending .pw-contact__transmit {
    display: block;
}

.pw-contact__transmit-output {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    font-family: 'Roboto', Helvetica, Verdana, Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 400;
    color: #888888;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    min-height: 12rem;
}

/* ─── Success screen ─────────────────────────────────────────── */

.pw-contact__step--success .pw-contact__step-body {
    width: 100%;
    max-width: 100%;
}

.pw-contact__step--success {
    justify-content: flex-start;
    gap: var(--gap-md);
}

.pw-contact__success-output {
    font-family: 'Roboto', Helvetica, Verdana, Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 400;
    color: #888888;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 72rem;
    margin: 0;
}

.pw-contact__success-actions {
    margin-top: 0;
}

.pw-contact__home-btn {
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
}

/* Mobile: stack main column then sidebar. */
@media (max-width: 767px) {
    .pw-contact__stage-head {
        grid-template-columns: 1fr;
    }

    .pw-contact__stage-progress {
        justify-content: flex-start;
        padding-top: 0;
    }

    .pw-contact__stage-progress .pw-contact__card-progress {
        justify-content: flex-start;
    }

    .pw-contact__workspace {
        grid-template-columns: 1fr;
        gap: var(--gap-md);
        align-items: start;
    }

    /* Feed sits just below the card (steps column shrinks to active step). */
    .pw-contact--has-aside .pw-contact__steps {
        min-height: 0;
    }

    .pw-contact--has-aside .pw-contact__step {
        position: relative;
        top: auto;
        left: auto;
        min-height: 0;
        padding-bottom: 0;
        overflow: hidden;
        margin: 0;
    }

    .pw-contact--has-aside .pw-contact__step:not(.pw-contact__step--current) {
        visibility: hidden;
        height: 0;
        min-height: 0;
        padding: 0;
        opacity: 0;
        pointer-events: none;
    }

    .pw-contact--has-aside .pw-contact__step.pw-contact__step--current {
        visibility: visible;
        height: auto;
        overflow: visible;
        opacity: 1;
    }

    .pw-contact--has-aside .pw-contact__aside {
        padding-top: 0;
        align-self: start;
        justify-self: start;
        width: 100%;
    }

    .pw-contact__fields {
        max-width: none;
        width: 100%;
    }

    .pw-contact__field {
        flex: 1 1 100%;
    }

    .pw-contact__step--services .pw-contact__svc-list,
    .pw-contact__step--services .pw-contact__svc-stack,
    .pw-contact__step--services .pw-contact__svc-col {
        max-width: 100%;
        width: 100%;
    }
}
