/* ================================================================
   Ruleta Spooky – Clínica Costa Verde
   ================================================================ */

.rsc-card {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: var(--rsc-ancho, 720px);
    margin: 0 auto;
    padding: 34px 48px 34px 30px;
    background: var(--rsc-bg, #1f1d1b);
    color: var(--rsc-texto, #d6cfc8);
    border-radius: var(--rsc-radio, 18px);
    font-family: var(--rsc-font, "DM Sans", sans-serif);
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}
.rsc-card *,
.rsc-card *::before,
.rsc-card *::after { box-sizing: border-box; }

.rsc-inline { margin: 0 auto 30px; }

/* Capa de efectos (emojis al ganar) */
.rsc-fx {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    z-index: 5;
}
.rsc-fx span {
    position: absolute;
    bottom: -40px;
    font-size: 26px;
    line-height: 1;
    animation: rscSube 2.6s cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes rscSube {
    0%   { transform: translateY(0) rotate(0); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translateY(-420px) rotate(var(--rot, 20deg)); opacity: 0; }
}

/* ---------------- Ruleta ---------------- */
.rsc-wheel-col {
    flex: 0 0 46%;
    min-width: 0;
}
.rsc-wheel {
    position: relative;
    width: 100%;
    max-width: 330px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}
.rsc-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
}
.rsc-pointer {
    position: absolute;
    left: -6%;
    top: 50%;
    width: 15%;
    transform: translateY(-50%);
    z-index: 2;
    line-height: 0;
    pointer-events: none;
    filter: drop-shadow(1px 2px 3px rgba(0,0,0,.35));
}
.rsc-pointer svg { display: block; width: 100%; height: auto; }
/* Burbuja con la descripción del premio */
.rsc-canvas { cursor: help; }
.rsc-girando .rsc-canvas { cursor: default; }
.rsc-tip {
    position: absolute;
    z-index: 4;
    width: max-content;
    max-width: 220px;
    padding: 10px 13px;
    background: #fff;
    color: #2b2826;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    font-size: 12.5px;
    line-height: 1.4;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -100%) translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
}
.rsc-tip[hidden] { display: none; }
.rsc-tip.is-on { opacity: 1; transform: translate(-50%, -100%); }
.rsc-tip strong {
    display: block;
    margin-bottom: 3px;
    color: var(--rsc-acento, #c4571a);
    font-size: 13px;
    font-weight: 700;
}
.rsc-tip span { display: block; }
.rsc-tip::after {
    content: "";
    position: absolute;
    left: calc(50% + var(--cola, 0px));
    bottom: -7px;
    margin-left: -8px;
    border: 8px solid transparent;
    border-bottom: 0;
    border-top-color: #fff;
}
.rsc-tip.rsc-tip-abajo { transform: translate(-50%, 0) translateY(-4px); }
.rsc-tip.rsc-tip-abajo.is-on { transform: translate(-50%, 0); }
.rsc-tip.rsc-tip-abajo::after {
    top: -7px;
    bottom: auto;
    border: 8px solid transparent;
    border-top: 0;
    border-bottom-color: #fff;
}

.rsc-card.rsc-girando .rsc-pointer { animation: rscPunt .12s ease-in-out infinite alternate; }
@keyframes rscPunt { from { transform: translateY(-50%) rotate(0); } to { transform: translateY(-50%) rotate(-7deg); } }

/* ---------------- Contenido ---------------- */
.rsc-content-col {
    flex: 1 1 auto;
    min-width: 0;
}
.rsc-titulo,
.rsc-result-titulo {
    margin: 0 0 10px;
    color: var(--rsc-titulo, #f3ede7);
    font-family: inherit;
    font-size: var(--rsc-titulo-size, 30px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.rsc-sub,
.rsc-result-sub {
    margin: 0 0 26px;
    color: var(--rsc-texto, #d6cfc8);
    font-size: var(--rsc-sub-size, 16px);
    line-height: 1.6;
}
.rsc-titulo p, .rsc-sub p, .rsc-result-titulo p, .rsc-result-sub p, .rsc-result-nota p { margin: 0; }

.rsc-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

/* all:unset aísla los campos de los estilos del tema / Elementor */
.rsc-card .rsc-input {
    all: unset;
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 18px;
    background: #fff;
    color: #1f1d1b;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    line-height: 50px;
    text-align: left;
    transition: border-color .2s, box-shadow .2s;
}
.rsc-card .rsc-input::placeholder { color: #8d8781; opacity: 1; }
.rsc-card .rsc-input:focus {
    border-color: var(--rsc-acento, #c4571a);
    box-shadow: 0 0 0 3px rgba(196, 87, 26, .35);
}
.rsc-card .rsc-input.rsc-invalido { border-color: #ff8a65; }

.rsc-card .rsc-btn,
.rsc-card .rsc-res-btn {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 18px;
    background: var(--rsc-acento, #c4571a);
    color: var(--rsc-btn-texto, #fff);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .02em;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter .2s, transform .15s;
}
.rsc-card .rsc-btn:hover,
.rsc-card .rsc-res-btn:hover { filter: brightness(1.1); color: var(--rsc-btn-texto, #fff); }
.rsc-card .rsc-btn:active { transform: translateY(1px); }
.rsc-card .rsc-btn:focus-visible,
.rsc-card .rsc-res-btn:focus-visible,
.rsc-card .rsc-nothanks:focus-visible,
.rsc-card .rsc-x:focus-visible { outline: 2px solid var(--rsc-acento, #c4571a); outline-offset: 3px; }
.rsc-card .rsc-btn:disabled { cursor: wait; filter: saturate(.7); opacity: .85; }

.rsc-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.rsc-error {
    margin: -2px 0 0;
    color: #ffab85;
    font-size: 13px;
    line-height: 1.4;
}
.rsc-error[hidden] { display: none; }

.rsc-legal {
    margin-top: 14px;
    color: var(--rsc-tenue, #9e978f);
    font-size: 11px;
    line-height: 1.5;
}
.rsc-legal a { color: inherit; }

.rsc-cerrada {
    padding: 16px 18px;
    border: 1px dashed var(--rsc-acento, #c4571a);
    border-radius: 8px;
    color: var(--rsc-titulo, #f3ede7);
}

.rsc-card .rsc-nothanks {
    all: unset;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--rsc-tenue, #9e978f);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: color .2s;
}
.rsc-card .rsc-nothanks:hover { color: var(--rsc-texto, #d6cfc8); }
.rsc-card .rsc-nothanks span { font-size: 15px; }

.rsc-card .rsc-x {
    all: unset;
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--rsc-tenue, #9e978f);
    font-family: Arial, sans-serif;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.rsc-card .rsc-x:hover { background: rgba(255,255,255,.08); color: var(--rsc-titulo, #f3ede7); }

/* ---------------- Resultado ---------------- */
.rsc-result[hidden], .rsc-intro[hidden] { display: none; }
.rsc-result { animation: rscEntra .5s ease both; }
@keyframes rscEntra { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.rsc-result-sub { margin-bottom: 14px; }
.rsc-result-premio {
    padding: 14px 16px;
    border: 2px dashed var(--rsc-acento, #c4571a);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    color: var(--rsc-titulo, #f3ede7);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}
.rsc-result-cond {
    margin-top: 8px;
    color: var(--rsc-tenue, #9e978f);
    font-size: 12.5px;
    line-height: 1.5;
}
.rsc-result-codigo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
}
.rsc-codigo {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--rsc-acento, #c4571a);
    color: var(--rsc-btn-texto, #fff);
    font-weight: 700;
    letter-spacing: .12em;
    user-select: all;
}
.rsc-card .rsc-res-btn { margin-top: 16px; text-decoration: none; }
.rsc-result-nota {
    margin-top: 14px;
    font-size: 13px;
}
.rsc-prueba {
    display: inline-block;
    margin-bottom: 10px;
    padding: 3px 9px;
    border-radius: 20px;
    background: #ffd54f;
    color: #3b2e00;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

/* ---------------- Popup ---------------- */
.rsc-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.rsc-overlay[hidden] { display: none; }
.rsc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    opacity: 0;
    transition: opacity .3s ease;
}
.rsc-dialog {
    position: relative;
    width: 100%;
    max-width: var(--rsc-ancho, 720px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--rsc-radio, 18px);
    box-shadow: 0 24px 70px rgba(0,0,0,.45);
    opacity: 0;
    transform: translateY(18px) scale(.97);
    transition: opacity .32s ease, transform .32s ease;
    scrollbar-width: none;
}
.rsc-dialog::-webkit-scrollbar { display: none; }
.rsc-overlay.is-open .rsc-backdrop { opacity: 1; }
.rsc-overlay.is-open .rsc-dialog { opacity: 1; transform: none; }
html.rsc-lock, html.rsc-lock body { overflow: hidden !important; }

/* ---------------- Celular ---------------- */
@media (max-width: 640px) {
    .rsc-card {
        flex-direction: column;
        gap: 18px;
        padding: 46px 20px 24px;
        text-align: center;
    }
    .rsc-wheel-col { flex: none; width: 100%; }
    .rsc-wheel { max-width: min(68vw, 270px); }
    .rsc-content-col { width: 100%; }
    .rsc-titulo, .rsc-result-titulo { font-size: calc(var(--rsc-titulo-size, 30px) * .8); }
    .rsc-sub, .rsc-result-sub { font-size: calc(var(--rsc-sub-size, 16px) * .92); margin-bottom: 18px; }
    .rsc-card .rsc-nothanks { margin-top: 16px; }
    .rsc-result-codigo { justify-content: center; }
    .rsc-overlay { padding: 10px; }
    .rsc-dialog { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
}

@media (prefers-reduced-motion: reduce) {
    .rsc-dialog, .rsc-backdrop, .rsc-result { transition: none; animation: none; }
    .rsc-fx { display: none; }
}
