/* P&ID — Asistente algorítmico de orientación */

.pid-guide button:focus-visible,
.pid-guide input:focus-visible,
.pid-guide textarea:focus-visible {
    outline: 3px solid rgba(244, 162, 97, .55);
    outline-offset: 2px;
}

.pid-guide-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(2, 8, 18, .72);
    backdrop-filter: blur(3px);
}

.pid-guide {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1100;
    display: flex;
    width: min(440px, calc(100vw - 32px));
    max-height: min(690px, calc(100vh - 112px));
    flex-direction: column;
    overflow: hidden;
    color: #dce6f1;
    background: #0b1525;
    border: 1px solid rgba(244, 162, 97, .35);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .55);
    font-family: var(--font-body, Inter, sans-serif);
    transform: translate(-50%, -50%);
}

.pid-guide[hidden],
.pid-guide-backdrop[hidden] {
    display: none;
}

.pid-guide__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.1rem;
    background: #101d30;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.pid-guide__brand {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    overflow: hidden;
    border-radius: 10px;
}

.pid-guide__brand img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pid-guide__heading {
    min-width: 0;
    flex: 1;
}

.pid-guide__heading strong,
.pid-guide__heading span {
    display: block;
}

.pid-guide__heading strong {
    color: #fff;
    font: 700 1rem/1.25 var(--font-heading, Outfit, sans-serif);
}

.pid-guide__heading span {
    margin-top: .12rem;
    color: #9fb0c4;
    font-size: .75rem;
}

.pid-guide__close,
.pid-guide__back {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    color: #dce6f1;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 9px;
    cursor: pointer;
}

.pid-guide__back[hidden] {
    display: none;
}

.pid-guide__body {
    overflow-y: auto;
    padding: 1.25rem;
    overscroll-behavior: contain;
}

.pid-guide__progress {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1rem;
    color: #f4a261;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pid-guide__progress::after {
    height: 1px;
    flex: 1;
    background: rgba(244, 162, 97, .25);
    content: "";
}

.pid-guide h2 {
    margin: 0 0 .65rem;
    color: #fff;
    font: 700 1.45rem/1.2 var(--font-heading, Outfit, sans-serif);
    letter-spacing: -.015em;
}

.pid-guide__lead {
    margin: 0 0 1rem;
    color: #aebdcd;
    font-size: .9rem;
    line-height: 1.6;
}

.pid-guide__notice {
    margin: 1rem 0 0;
    padding: .75rem .85rem;
    color: #b7c6d6;
    background: rgba(93, 138, 168, .1);
    border: 1px solid rgba(93, 138, 168, .24);
    border-radius: 9px;
    font-size: .78rem;
    line-height: 1.5;
}

.pid-guide__options {
    display: grid;
    gap: .65rem;
}

.pid-guide__option {
    display: flex;
    width: 100%;
    align-items: center;
    gap: .8rem;
    padding: .85rem .9rem;
    color: #edf4fb;
    text-align: left;
    background: #111e31;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.pid-guide__option:hover {
    background: #15243a;
    border-color: rgba(244, 162, 97, .55);
}

.pid-guide__option span:first-child {
    flex: 1;
    font-size: .88rem;
    font-weight: 650;
    line-height: 1.4;
}

.pid-guide__option span:last-child {
    color: #f4a261;
    font-size: 1rem;
}

.pid-guide__summary {
    display: grid;
    gap: .55rem;
    margin: 1rem 0;
    padding: .9rem;
    background: #101d30;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
}

.pid-guide__summary-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: .75rem;
    font-size: .78rem;
    line-height: 1.45;
}

.pid-guide__summary-row span:first-child {
    color: #8fa2b7;
}

.pid-guide__summary-row span:last-child {
    color: #e5edf5;
    font-weight: 600;
}

.pid-guide__priority {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    margin: 0 0 1rem;
    padding: .8rem;
    background: rgba(217, 90, 17, .11);
    border: 1px solid rgba(244, 162, 97, .32);
    border-radius: 10px;
}

.pid-guide__priority strong,
.pid-guide__priority span {
    display: block;
}

.pid-guide__priority strong {
    color: #f4a261;
    font-size: .84rem;
}

.pid-guide__priority span {
    margin-top: .18rem;
    color: #b8c6d4;
    font-size: .74rem;
    line-height: 1.45;
}

.pid-guide__recommendation {
    margin: 1rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(93, 138, 168, .14), rgba(17, 30, 49, .82));
    border: 1px solid rgba(93, 138, 168, .3);
    border-left: 3px solid #5d8aa8;
    border-radius: 10px;
}

.pid-guide__recommendation span,
.pid-guide__recommendation strong,
.pid-guide__recommendation p {
    display: block;
}

.pid-guide__recommendation span {
    margin-bottom: .35rem;
    color: #8fa8c0;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.pid-guide__recommendation strong {
    color: #fff;
    font-size: 1rem;
    line-height: 1.35;
}

.pid-guide__recommendation p {
    margin: .45rem 0 0;
    color: #b7c5d4;
    font-size: .78rem;
    line-height: 1.55;
}

.pid-guide__recommendation--compact {
    margin: 0 0 .85rem;
    padding: .8rem;
}

.pid-guide__actions {
    display: grid;
    gap: .6rem;
}

.pid-guide__secondary {
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: .7rem 1rem;
    color: #dce6f1;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, .32);
    border-radius: 9px;
    font: 700 .85rem/1.2 var(--font-body, Inter, sans-serif);
    cursor: pointer;
}

.pid-guide__secondary:hover {
    background: rgba(148, 163, 184, .08);
    border-color: rgba(244, 162, 97, .45);
}

.pid-guide__text-action {
    justify-self: center;
    padding: .35rem;
    color: #9fb0c4;
    background: transparent;
    border: 0;
    font: 600 .75rem/1.4 var(--font-body, Inter, sans-serif);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.pid-guide__field label span {
    color: #8fa2b7;
    font-size: .68rem;
    font-weight: 500;
}

.pid-guide__form {
    display: grid;
    gap: .85rem;
}

.pid-guide__field {
    display: grid;
    gap: .38rem;
}

.pid-guide__field label,
.pid-guide__fieldset legend {
    color: #eef4fa;
    font-size: .78rem;
    font-weight: 700;
}

.pid-guide__field input,
.pid-guide__field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: .78rem .82rem;
    color: #fff;
    background: #0a1423;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 9px;
    font: inherit;
}

.pid-guide__field textarea {
    min-height: 94px;
    resize: vertical;
}

.pid-guide__field input::placeholder,
.pid-guide__field textarea::placeholder {
    color: #718399;
}

.pid-guide__fieldset {
    margin: 0;
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 10px;
}

.pid-guide__contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
}

.pid-guide__help {
    margin: .3rem 0 .65rem;
    color: #92a5ba;
    font-size: .72rem;
}

.pid-guide__consent {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: .55rem;
    color: #b5c3d2;
    font-size: .72rem;
    line-height: 1.5;
}

.pid-guide__consent input {
    width: 18px;
    height: 18px;
    margin: .1rem 0 0;
    accent-color: #d95a11;
}

.pid-guide__consent a {
    color: #f4a261;
}

.pid-guide__submit,
.pid-guide__start {
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: .75rem 1rem;
    color: #fff;
    background: #d95a11;
    border: 0;
    border-radius: 9px;
    font: 700 .9rem/1.2 var(--font-body, Inter, sans-serif);
    cursor: pointer;
}

.pid-guide__submit:disabled {
    cursor: wait;
    opacity: .7;
}

.pid-guide__status {
    margin: 0;
    padding: .75rem;
    border-radius: 9px;
    font-size: .78rem;
    line-height: 1.5;
}

.pid-guide__status--error {
    color: #ffd7d7;
    background: rgba(190, 40, 40, .16);
    border: 1px solid rgba(255, 110, 110, .35);
}

.pid-guide__success {
    text-align: center;
}

.pid-guide__success-icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    place-items: center;
    color: #fff;
    background: #1f9d61;
    border-radius: 50%;
    font-size: 1.4rem;
}

body.pid-guide-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .pid-guide {
        inset: 0;
        width: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        transform: none;
    }

    .pid-guide__header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .pid-guide__body {
        padding: 1.1rem;
    }
}

@media (max-width: 420px) {
    .pid-guide__contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pid-guide__option {
        transition: none;
    }
}
