/* ==========================================================
   AAM — Popup de testemunhos da comunidade v9
   Correção de alinhamento vertical dos campos
========================================================== */

.aam-testemunho-page-notice {
    position: fixed;
    left: 50%;
    top: 108px;
    z-index: 100000;
    width: min(calc(100% - 32px), 680px);
    padding: 12px 16px;
    transform: translateX(-50%);
    background: #fff;
    color: var(--color-black, #090E11);
    border: 1px solid var(--color-primary, #7E0E3B);
    border-radius: 7px;
    box-shadow: 0 12px 34px rgba(9, 14, 17, 0.12);
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.aam-testemunho-page-notice--success {
    border-color: #008a20;
}

.aam-testemunho-page-notice--error {
    border-color: #b32d2e;
}

.aam-historia-cta__button[data-aam-testemunho-open],
.alunos-share-story__button[data-aam-testemunho-open] {
    border: 0;
    cursor: pointer;
}

.aam-testemunho-modal[hidden] {
    display: none !important;
}

.aam-testemunho-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 20px;
}

.aam-testemunho-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 14, 17, 0.42);
}

.aam-testemunho-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(100%, 860px);
    max-height: min(88vh, 860px);
    overflow-y: auto;
    padding: clamp(24px, 3vw, 34px);
    background: var(--color-bg, #FEFEFE);
    border: 1px solid var(--color-primary, #7E0E3B);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(9, 14, 17, 0.22);
}

.aam-testemunho-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: var(--color-primary, #7E0E3B);
    border: 1px solid rgba(126, 14, 59, 0.26);
    border-radius: 50%;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.aam-testemunho-modal__header {
    max-width: 620px;
    margin: 0 auto 24px;
    text-align: center;
}

.aam-testemunho-modal__header p {
    margin: 0 0 8px;
    color: var(--color-primary, #7E0E3B);
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.aam-testemunho-modal__header h2 {
    margin: 0;
    color: var(--color-black, #090E11);
    font-family: var(--font-heading, "Cormorant Garamond", serif);
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 500;
    line-height: 1.04;
}

.aam-testemunho-modal__header span {
    display: block;
    width: 74px;
    height: 1px;
    margin: 14px auto 0;
    background: rgba(126, 14, 59, 0.34);
}

.aam-testemunho-form {
    display: grid;
    gap: 20px;
    margin: 0;
}

.aam-testemunho-form__honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.aam-testemunho-form__choice {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
}

.aam-testemunho-form__choice legend {
    width: 100%;
    margin-bottom: 2px;
    color: var(--color-black, #090E11);
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.aam-testemunho-form__choice label {
    cursor: pointer;
}

.aam-testemunho-form__choice input {
    position: absolute;
    opacity: 0;
}

.aam-testemunho-form__choice span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
    color: var(--color-primary, #7E0E3B);
    border: 1px solid var(--color-primary, #7E0E3B);
    border-radius: 5px;
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
}

.aam-testemunho-form__choice input:checked + span {
    background: var(--color-primary, #7E0E3B);
    color: #fff;
}

.aam-testemunho-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    align-items: start;
}

.aam-testemunho-field {
    display: grid;
    align-self: start;
    align-content: start;
    gap: 7px;
}

.aam-testemunho-field--full {
    grid-column: 1 / -1;
}

.aam-testemunho-field span {
    color: var(--color-black, #090E11);
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.aam-testemunho-field strong {
    color: var(--color-primary, #7E0E3B);
}

.aam-testemunho-field input,
.aam-testemunho-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    background: #fff;
    color: var(--color-black, #090E11);
    border: 1px solid rgba(9, 14, 17, 0.20);
    border-radius: 6px;
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
}

.aam-testemunho-field input::placeholder,
.aam-testemunho-field textarea::placeholder {
    color: rgba(9, 14, 17, 0.42);
}

.aam-testemunho-field input[type="file"] {
    min-height: 0;
    padding: 9px 12px;
    font-size: 14px;
}

.aam-testemunho-field textarea {
    min-height: 98px;
    padding-top: 10px;
    resize: vertical;
}

.aam-testemunho-field small,
.aam-testemunho-form__hint,
.aam-testemunho-form__note {
    color: rgba(9, 14, 17, 0.58);
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 13px;
    font-weight: 300;
    line-height: 1.38;
}

.aam-testemunho-form__conditional {
    display: grid;
    gap: 16px;
    padding: 18px;
    background: rgba(250, 238, 243, 0.48);
    border: 1px solid rgba(126, 14, 59, 0.20);
    border-radius: 10px;
}

.aam-testemunho-form__conditional[hidden] {
    display: none !important;
}

.aam-testemunho-form__conditional h3 {
    margin: 0;
    color: var(--color-primary, #7E0E3B);
    font-family: var(--font-heading, "Cormorant Garamond", serif);
    font-size: clamp(24px, 2.2vw, 30px);
    font-weight: 500;
    line-height: 1.05;
}

.aam-testemunho-form__hint,
.aam-testemunho-form__note {
    margin: 0;
}

.aam-testemunho-repeat {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.aam-testemunho-journey {
    display: grid;
    gap: 14px;
}

.aam-testemunho-journey__row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(126, 14, 59, 0.18);
}

.aam-testemunho-form__consent {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: rgba(9, 14, 17, 0.76);
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 14px;
    line-height: 1.36;
}

.aam-testemunho-form__consent input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--color-primary, #7E0E3B);
}

.aam-testemunho-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.aam-testemunho-form__secondary,
.aam-testemunho-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 22px;
    border-radius: 5px;
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.aam-testemunho-form__secondary {
    background: transparent;
    color: var(--color-primary, #7E0E3B);
    border: 1px solid rgba(126, 14, 59, 0.42);
}

.aam-testemunho-form__submit {
    background: var(--color-primary, #7E0E3B);
    color: #fff;
    border: 1px solid var(--color-primary, #7E0E3B);
}

.aam-testemunho-form__submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

body.aam-testemunho-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .aam-testemunho-modal {
        padding: 12px;
    }

    .aam-testemunho-modal__dialog {
        max-height: 92vh;
        padding: 24px 16px;
        border-radius: 14px;
    }

    .aam-testemunho-modal__header {
        margin-bottom: 22px;
    }

    .aam-testemunho-modal__header h2 {
        font-size: clamp(28px, 8vw, 34px);
    }

    .aam-testemunho-form {
        gap: 18px;
    }

    .aam-testemunho-form__grid,
    .aam-testemunho-repeat,
    .aam-testemunho-journey__row {
        grid-template-columns: 1fr;
    }

    .aam-testemunho-form__conditional {
        padding: 16px;
    }

    .aam-testemunho-form__actions {
        flex-direction: column-reverse;
    }

    .aam-testemunho-form__secondary,
    .aam-testemunho-form__submit {
        width: 100%;
    }
}

/* Estado de submissão dentro do popup */

.aam-testemunho-success[hidden],
.aam-testemunho-error[hidden],
.aam-testemunho-form[hidden] {
    display: none !important;
}

.aam-testemunho-success {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: clamp(28px, 5vw, 54px) 18px;
    text-align: center;
}

.aam-testemunho-success:focus {
    outline: 0;
}

.aam-testemunho-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 4px;
    background: var(--color-primary, #7E0E3B);
    color: #fff;
    border-radius: 50%;
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.aam-testemunho-success h3 {
    margin: 0;
    color: var(--color-black, #090E11);
    font-family: var(--font-heading, "Cormorant Garamond", serif);
    font-size: clamp(28px, 2.5vw, 40px);
    font-weight: 500;
    line-height: 1.08;
}

.aam-testemunho-success p {
    max-width: 520px;
    margin: 0;
    color: rgba(9, 14, 17, 0.66);
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: var(--fs-body-sm, 16px);
    font-weight: 300;
    line-height: 1.45;
}

.aam-testemunho-error {
    padding: 12px 14px;
    background: #fff5f5;
    color: #9B0D3F;
    border: 1px solid rgba(155, 13, 63, 0.38);
    border-radius: 8px;
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: var(--fs-body-sm, 16px);
    font-weight: 600;
    line-height: 1.35;
}

.aam-testemunho-form__submit:disabled {
    opacity: 0.68;
    cursor: wait;
}

/* ==========================================================
   AAM — Popup testemunhos v10
   Erros dentro do formulário + escala visual refinada
========================================================== */

.aam-testemunho-modal__dialog {
    width: min(100%, 860px);
    padding: clamp(24px, 3.2vw, 38px);
}

.aam-testemunho-form {
    gap: 22px;
}

.aam-testemunho-form__actions {
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding-top: 4px;
    margin-top: 0;
}

.aam-testemunho-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 11px 13px;
    background: rgba(155, 13, 63, 0.045);
    color: var(--color-primary, #7E0E3B);
    border: 1px solid rgba(155, 13, 63, 0.25);
    border-radius: 8px;
    font-family: var(--font-body, "Source Sans 3", sans-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.aam-testemunho-error::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: #fff;
    background: var(--color-primary, #7E0E3B);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.aam-testemunho-form__secondary,
.aam-testemunho-form__submit {
    min-height: 42px;
    padding-inline: 22px;
    font-size: 15px;
}

@media (max-width: 767px) {
    .aam-testemunho-form__actions {
        gap: 10px;
    }

    .aam-testemunho-error {
        font-size: 13px;
    }
}
