/* =========================================
   SOLICITUD DE RECETA POR SUCURSAL (estilo bioformula.cl)
   ========================================= */
.rx-page {
    background: #F2F3F5;
}

.rx-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero */
.rx-hero {
    background-color: var(--text-dark);
    background-size: cover;
    background-position: center;
    color: white;
    padding: 70px 0;
}

.rx-kicker {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.rx-hero h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 10px;
}

.rx-hero p {
    font-size: 17px;
    opacity: 0.95;
}

/* Selector de sucursal */
.rx-body {
    padding: 40px 0 70px;
}

.rx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.rx-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 30px;
    background: white;
    border: 1px solid #E3E6EA;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s;
}

.rx-chip i {
    color: var(--primary-color);
}

.rx-chip:hover {
    border-color: var(--primary-color);
}

.rx-chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.rx-chip.active i {
    color: white;
}

/* Layout */
.rx-grid-main {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 40px;
    align-items: start;
}

.rx-aside {
    position: sticky;
    top: 110px;
}

.rx-img {
    width: 100%;
    border-radius: 12px;
    display: block;
    margin-bottom: 22px;
    background: #E3E6EA;
}

.rx-aside h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.rx-note {
    background: #FFF6E0;
    border-left: 4px solid var(--rating-color);
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.rx-note i {
    color: #C99A00;
    margin-right: 4px;
}

.rx-facts {
    list-style: none;
}

.rx-facts li {
    display: flex;
    gap: 12px;
    align-items: baseline;
    color: var(--text-light);
    font-size: 15px;
    padding: 8px 0;
    border-bottom: 1px solid #E3E6EA;
}

.rx-facts i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.rx-facts a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
}

/* Formulario */
.rx-form,
.rx-success {
    background: white;
    border-radius: 12px;
    padding: 34px;
    box-shadow: 0 10px 30px rgba(29, 42, 56, 0.07);
}

.rx-form-head h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.rx-form-head p {
    color: var(--text-light);
    margin-bottom: 22px;
}

.rx-folio {
    font-size: 14px;
    color: var(--text-light);
    margin: -8px 0 20px;
}

.rx-folio strong {
    color: var(--primary-dark);
}

/* ¿Qué necesitas? */
.rx-toggle {
    display: inline-flex;
    background: #F2F3F5;
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.rx-toggle label {
    cursor: pointer;
}

.rx-toggle input {
    position: absolute;
    opacity: 0;
}

.rx-toggle span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.2s;
}

.rx-toggle input:checked + span {
    background: white;
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(29, 42, 56, 0.12);
}

.rx-toggle input:focus-visible + span {
    outline: 2px solid var(--primary-color);
}

/* Zona de subida */
.rx-drop {
    position: relative;
    border: 2px dashed #B9E4E5;
    background: #F4FBFB;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.rx-drop:hover,
.rx-drop.dragging {
    border-color: var(--primary-color);
    background: #E9F7F7;
}

.rx-drop.invalid {
    border-color: var(--danger-color);
    background: #FDF3F4;
}

.rx-drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.rx-drop i {
    font-size: 30px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.rx-drop strong {
    color: var(--text-dark);
    font-size: 16px;
}

.rx-drop span {
    color: var(--text-light);
    font-size: 13px;
}

.rx-file-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.rx-file-list li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #E9F7F7;
    color: var(--primary-dark);
    border-radius: 20px;
    padding: 6px 8px 6px 14px;
    font-size: 13px;
    font-weight: 600;
    max-width: 100%;
}

.rx-file-list li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.rx-file-list button {
    border: 0;
    background: white;
    color: var(--text-light);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.rx-file-list button:hover {
    color: var(--danger-color);
}

/* Campos */
.rx-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 26px 0 14px;
}

.rx-subtitle i {
    color: var(--primary-color);
    font-size: 14px;
}

.rx-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

.rx-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rx-full {
    grid-column: 1 / -1;
}

.rx-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.rx-field input,
.rx-field select,
.rx-more textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D5D8DC;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rx-field input:focus,
.rx-field select:focus,
.rx-more textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(36, 174, 177, 0.15);
}

.rx-field.invalid input {
    border-color: var(--danger-color);
}

.rx-field.valid input {
    border-color: #7CCB9A;
}

.rx-hint {
    font-size: 12px;
    color: var(--text-light);
}

.rx-error {
    font-size: 12px;
    font-weight: 600;
    color: var(--danger-color);
    min-height: 0;
}

.rx-error:empty {
    display: none;
}

.rx-field.invalid .rx-hint {
    display: none;
}

.rx-drop-error {
    display: block;
    margin-top: 6px;
}

/* Comentario opcional */
.rx-more {
    margin-top: 18px;
}

.rx-more summary {
    list-style: none;
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rx-more summary::-webkit-details-marker {
    display: none;
}

.rx-more[open] summary i {
    transform: rotate(45deg);
}

.rx-more summary i {
    transition: transform 0.2s;
}

.rx-more textarea {
    margin-top: 10px;
    resize: vertical;
}

/* Estado y envío */
.rx-status {
    display: none;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.rx-status.show {
    display: block;
}

.rx-status.error {
    background: #FDECEE;
    color: #9B1C2C;
    border: 1px solid #F5C2C9;
}

.rx-submit {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 17px;
    margin-top: 22px;
}

.rx-privacy {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 12px;
}

/* Confirmación */
.rx-success {
    text-align: center;
    padding: 50px 34px;
}

.rx-success > i {
    font-size: 56px;
    color: #27AE60;
    margin-bottom: 14px;
}

.rx-success h2 {
    font-size: 26px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.rx-success p {
    color: var(--text-light);
    margin-bottom: 6px;
}

.rx-success p strong {
    color: var(--primary-dark);
    font-size: 18px;
}

.rx-success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.rx-btn-outline {
    border: 2px solid var(--primary-color);
}

/* Responsive */
@media (max-width: 992px) {
    .rx-grid-main {
        grid-template-columns: 1fr;
    }

    .rx-aside {
        position: static;
    }

    .rx-img {
        max-height: 260px;
        object-fit: cover;
    }
}

@media (max-width: 600px) {
    .rx-hero {
        padding: 50px 0;
    }

    .rx-hero h1 {
        font-size: 30px;
    }

    .rx-form {
        padding: 24px 18px;
    }

    .rx-grid {
        grid-template-columns: 1fr;
    }

    .rx-toggle {
        display: flex;
    }

    .rx-toggle label {
        flex: 1;
    }

    .rx-toggle span {
        width: 100%;
        justify-content: center;
        padding: 9px 10px;
    }

    .rx-success {
        padding: 36px 20px;
    }
}

/* =========================================
   v3 – Formulario accesible (todas las edades)
   ========================================= */
.af-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.rx-form-head h2 {
    font-size: 1.75rem;
}

.rx-form-head p {
    font-size: 1.08rem;
    color: #3E4A5A;
}

.rx-folio {
    font-size: 1rem;
    color: #3E4A5A;
    margin: 0 0 1.2rem;
}

.af-group {
    padding-top: 0.4rem;
}

.af-group + .af-group {
    border-top: 0 !important;
    box-shadow: 0 -1px 0 #E3E6EA;   /* línea divisoria sin cortar el título */
    padding-top: 1.6rem !important;
}

.af-choices-2 {
    grid-template-columns: 1fr 1fr;
}

fieldset.invalid .af-choice-box {
    border-color: #B42318;
}

/* Zona de subida: grande y clara */
.rx-drop {
    padding: 1.8rem 1.2rem;
    gap: 0.5rem;
    border-width: 3px;
    border-color: #7CC9CB;
}

.rx-drop:focus-within {
    outline: 3px solid #FFB020;
    outline-offset: 3px;
}

.rx-drop i.fa-camera {
    font-size: 2.2rem;
}

.rx-drop-label {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #1D2A38 !important;
    margin: 0 !important;
}

.rx-drop span {
    font-size: 1rem;
    color: #3E4A5A;
}

.rx-drop .rx-drop-btn {
    margin-top: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0E7C7E;
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.7rem 1.3rem;
    border-radius: 10px;
}

.rx-drop.invalid {
    border-color: #B42318;
    background: #FEF3F2;
}

.rx-file-list li {
    font-size: 1rem;
    padding: 6px 6px 6px 14px;
    gap: 10px;
}

.rx-file-list li span {
    max-width: 260px;
}

.rx-file-list button {
    width: auto;
    height: 36px;
    border-radius: 8px;
    padding: 0 0.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #B42318;
    border: 1px solid #F1B5AE;
    font-family: inherit;
}

.rx-files-count {
    font-size: 0.98rem;
    color: #1E7B3A;
    font-weight: 600;
    margin: 0.5rem 0 0;
}

.rx-files-count:empty {
    display: none;
}

/* Comentario opcional */
.rx-more summary {
    font-size: 1.08rem;
    min-height: 44px;
}

/* Envío */
.rx-privacy {
    font-size: 0.95rem;
    color: #3E4A5A;
}

/* Paneles de resultado */
.rx-success,
.rx-fallback {
    padding: 2rem;
}

.rx-success {
    text-align: left;
}

.rx-success-icon {
    font-size: 3rem;
    color: #1E7B3A;
    margin-bottom: 0.6rem;
}

.rx-success h2,
.rx-fallback h2 {
    font-size: 1.6rem;
    color: #1D2A38;
    margin-bottom: 0.6rem;
    display: flex;
    gap: 10px;
    align-items: center;
}

.rx-fallback h2 i {
    color: #B54708;
}

.rx-success p,
.rx-fallback p {
    font-size: 1.08rem;
    color: #1D2A38;
}

.rx-success p strong {
    font-size: 1.2rem;
    color: #0E7C7E;
}

.rx-test-note {
    background: #FFF8E6;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.98rem !important;
}

.rx-fallback-actions .rx-submit {
    width: auto;
    padding: 0 1.6rem;
    text-decoration: none;
    color: white !important;
}

.rx-fallback-actions .af-btn-light {
    min-height: 60px;
    font-size: 1.1rem;
}

.rx-fallback-tip {
    background: white;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin: 1rem 0 !important;
}

/* Columna lateral de "¿Cómo funciona?" */
.rx-how {
    list-style: none;
    margin: 0 0 1.2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.rx-how li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 1.05rem;
    line-height: 1.45;
    color: #1D2A38;
}

.rx-how span {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #0E7C7E;
    color: white;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rx-aside h2 {
    font-size: 1.25rem;
}

.rx-note,
.rx-facts li {
    font-size: 1rem;
    color: #3E4A5A;
}

@media (max-width: 700px) {
    .af-choices-2 {
        grid-template-columns: 1fr;
    }

    .rx-success,
    .rx-fallback {
        padding: 1.4rem 1.1rem;
    }

    .rx-fallback-actions .rx-submit,
    .rx-fallback-actions .af-btn-light {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   v5 – Aviso de evaluación y casilla de Términos
   ========================================= */
.rx-evaluacion {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #EEF6FF;
    border: 2px solid #B9D6F5;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin: 1.6rem 0 1.2rem;
}

.rx-evaluacion i {
    font-size: 1.6rem;
    color: #0E7C7E;
    margin-top: 2px;
}

.rx-evaluacion p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #1D2A38;
}

.rx-terms {
    background: #F7FAFA;
    border: 2px solid #C9D2DB;
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.rx-terms .af-check {
    font-size: 1.05rem !important;
    color: #1D2A38;
    margin: 0 !important;
}

.rx-terms .af-check a {
    color: #0E7C7E;
    font-weight: 700;
    text-decoration: underline;
}

.rx-terms.invalid {
    border-color: #B42318;
    background: #FEF3F2;
}

.rx-terms:has(input:checked) {
    border-color: #1E8E3E;
    background: #ECFDF3;
}

/* Botón "Sí, corregir" cuando el correo parece mal escrito (ej: gmial.com) */
.rx-sugerencia {
    margin-left: 4px;
    padding: 2px 10px;
    border: 1.5px solid currentColor;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.rx-sugerencia:hover, .rx-sugerencia:focus-visible { background: #fdecea; }
