/* Apariencia general del widget. */
.ssr-rating {
    --ssr-star-empty: #ccc;
    --ssr-star-filled: #f5d061;
    --ssr-star-hover: #f5d061;
    --ssr-average-text-color: #333333;
    --ssr-votes-text-color: #333333;
    --ssr-text-font: Arial, sans-serif;
    --ssr-result-font-size: 16px;
    --ssr-user-message-font-size: 12px;
    --ssr-results-text-align: left;
    --ssr-feedback-button-bg: #2271b1;
    --ssr-feedback-button-color: #fff;
    --ssr-feedback-button-font: Arial, sans-serif;
    --ssr-feedback-button-size: 16px;
    --ssr-feedback-form-font: Arial, sans-serif;
    --ssr-feedback-form-size: 16px;
    --ssr-feedback-form-color: #1d2327;
    --ssr-feedback-field-color: #1d2327;
    --ssr-feedback-form-bg: #fff;
    --ssr-feedback-accent: #2271b1;
    display: inline-block;
    margin: 10px 0;
    font-family: Arial, sans-serif;
}

.ssr-display-text {
    margin-bottom: 8px;
    font-family: var(--ssr-text-font, Arial, sans-serif);
    font-size: var(--ssr-result-font-size, 16px);
    font-weight: 500;
    text-align: var(--ssr-results-text-align, left);
}

.ssr-average-part { color: var(--ssr-average-text-color, #333); }
.ssr-votes-part { color: var(--ssr-votes-text-color, #333); }
.ssr-rating.ssr-average-mode-after_vote:not(.ssr-voted) .ssr-display { display: none; }
.ssr-rate { display: inline-block; user-select: none; }

.ssr-star {
    display: inline-block;
    margin-right: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ssr-star-empty);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transition: color .1s ease;
}

.ssr-rate .ssr-star {
    color: var(--ssr-bottom-star-color, var(--ssr-star-empty, #ccc)) !important;
    cursor: pointer;
    pointer-events: auto !important;
}

.ssr-rate .ssr-star.filled,
.ssr-rate .ssr-star.selected { color: var(--ssr-bottom-star-filled, var(--ssr-star-filled, #f5d061)) !important; }
.ssr-rate .ssr-star.hovered { color: var(--ssr-star-hover, #f5d061) !important; }
.ssr-rate .ssr-star:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }

.ssr-star-style-outline .ssr-star,
.ssr-star-style-sparkle .ssr-star {
    width: 28px;
    font-size: 0;
    text-align: center;
    vertical-align: top;
}
.ssr-star-style-outline .ssr-star::before { content: "☆"; font-size: 30px; line-height: .93; }
.ssr-star-style-outline .ssr-star.selected::before,
.ssr-star-style-outline .ssr-star.filled::before,
.ssr-star-style-outline .ssr-star.hovered::before { content: "★"; }

.ssr-star-style-rounded .ssr-star {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    margin-right: 5px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 22px;
    line-height: 30px;
    text-align: center;
    vertical-align: middle;
}

.ssr-star-style-sparkle .ssr-star::before { content: "✧"; font-size: 27px; line-height: 1; }
.ssr-star-style-sparkle .ssr-star.selected::before,
.ssr-star-style-sparkle .ssr-star.filled::before,
.ssr-star-style-sparkle .ssr-star.hovered::before { content: "✦"; }

.ssr-rating.ssr-voted .ssr-rate { pointer-events: none !important; opacity: .6; }
.ssr-rating.ssr-voted .ssr-rate .ssr-star { pointer-events: none !important; cursor: default !important; }
.ssr-rating.ssr-voted .ssr-rate .ssr-star.selected { color: var(--ssr-bottom-star-filled, var(--ssr-star-filled, #f5d061)) !important; }

.ssr-user-msg {
    display: none;
    margin-top: 5px;
    color: #888;
    font-family: var(--ssr-text-font, Arial, sans-serif);
    font-size: var(--ssr-user-message-font-size, 12px);
}

.ssr-config-warning {
    padding: 10px 12px;
    border-left: 4px solid #dba617;
    background: #fff8e5;
    color: #5b4a00;
}

/* Botón de apertura. */
.ssr-feedback { margin-top: 12px; font-family: var(--ssr-feedback-button-font, Arial, sans-serif); }
.ssr-rating:not(.ssr-voted) .ssr-feedback-toggle,
.ssr-rating.ssr-rating-saving .ssr-feedback-toggle { display: none; }

.ssr-feedback-toggle {
    appearance: none;
    border: 1px solid var(--ssr-feedback-button-bg, #2271b1);
    border-radius: 7px;
    background: var(--ssr-feedback-button-bg, #2271b1);
    color: var(--ssr-feedback-button-color, #fff);
    padding: .65em 1.05em;
    cursor: pointer;
    font-family: var(--ssr-feedback-button-font, Arial, sans-serif);
    font-size: var(--ssr-feedback-button-size, 16px);
    font-weight: 600;
    line-height: 1.2;
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ssr-feedback-toggle:hover { filter: brightness(.92); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.13); }
.ssr-feedback-toggle:focus-visible { outline: 3px solid var(--ssr-feedback-accent, #2271b1); outline-offset: 3px; }

/* Ventana modal dentro del sitio. */
body.ssr-feedback-modal-open { overflow: hidden; }
.ssr-feedback-modal[hidden],
.ssr-feedback-complete[hidden] { display: none !important; }

.ssr-feedback-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding: 24px;
    font-family: var(--ssr-feedback-form-font, Arial, sans-serif);
    font-size: var(--ssr-feedback-form-size, 16px);
    color: var(--ssr-feedback-form-color, #1d2327);
}

.ssr-feedback-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .66);
    backdrop-filter: blur(3px);
}

.ssr-feedback-dialog {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(960px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 16px;
    background: var(--ssr-feedback-form-bg, #fff);
    color: var(--ssr-feedback-form-color, #1d2327);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
    animation: ssrFeedbackEnter .18s ease-out;
}

@keyframes ssrFeedbackEnter {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ssr-feedback-header {
    padding: 24px 64px 16px 28px;
    border-bottom: 1px solid rgba(15, 23, 42, .11);
}
.ssr-feedback-header h2 {
    margin: 0 0 5px;
    color: var(--ssr-feedback-form-color, #1d2327);
    font: inherit;
    font-size: 1.35em;
    font-weight: 700;
    line-height: 1.25;
}
.ssr-feedback-header p { margin: 0; color: var(--ssr-feedback-form-color, #1d2327); opacity: .72; font-size: .9em; }

.ssr-feedback-close {
    position: absolute;
    z-index: 2;
    top: 14px;
    right: 16px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ssr-feedback-form-color, #1d2327);
    cursor: pointer;
    font: inherit;
    font-size: 28px;
    line-height: 34px;
}
.ssr-feedback-close:hover { background: rgba(15, 23, 42, .08); }
.ssr-feedback-close:focus-visible { outline: 3px solid var(--ssr-feedback-accent, #2271b1); outline-offset: 2px; }

.ssr-feedback-form { box-sizing: border-box; padding: 22px 28px 26px; text-align: left; }
.ssr-feedback-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 18px 22px;
}
.ssr-feedback-fields-1 { grid-template-columns: 1fr; }
.ssr-feedback-field { min-width: 0; }
.ssr-feedback-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--ssr-feedback-form-color, #1d2327);
    font-weight: 650;
    line-height: 1.35;
}
.ssr-feedback-field textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 118px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, .28);
    border-radius: 9px;
    background: #fff;
    color: var(--ssr-feedback-field-color, #1d2327);
    font-family: var(--ssr-feedback-form-font, Arial, sans-serif);
    font-size: 1em;
    line-height: 1.45;
}
.ssr-feedback-field textarea:focus {
    border-color: var(--ssr-feedback-accent, #2271b1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ssr-feedback-accent, #2271b1) 22%, transparent);
    outline: 0;
}
@supports not (color: color-mix(in srgb, red, blue)) {
    .ssr-feedback-field textarea:focus { box-shadow: 0 0 0 2px var(--ssr-feedback-accent, #2271b1); }
}
.ssr-feedback-counter {
    display: block;
    margin-top: 5px;
    color: var(--ssr-feedback-form-color, #1d2327);
    opacity: .62;
    text-align: right;
    font-size: .78em;
}

.ssr-feedback-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(15, 23, 42, .11);
}
.ssr-feedback-note { margin: 0; color: var(--ssr-feedback-form-color, #1d2327); opacity: .68; font-size: .8em; }
.ssr-feedback-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ssr-feedback-cancel,
.ssr-feedback-submit {
    appearance: none;
    border-radius: 7px;
    padding: .7em 1.05em;
    cursor: pointer;
    font: inherit;
    font-size: .92em;
    font-weight: 650;
    line-height: 1.2;
}
.ssr-feedback-cancel { border: 1px solid rgba(15, 23, 42, .25); background: transparent; color: var(--ssr-feedback-form-color, #1d2327); }
.ssr-feedback-submit { border: 1px solid var(--ssr-feedback-accent, #2271b1); background: var(--ssr-feedback-accent, #2271b1); color: #fff; }
.ssr-feedback-cancel:hover { background: rgba(15, 23, 42, .06); }
.ssr-feedback-submit:hover { filter: brightness(.92); }
.ssr-feedback-cancel:focus-visible,
.ssr-feedback-submit:focus-visible { outline: 3px solid var(--ssr-feedback-accent, #2271b1); outline-offset: 2px; }
.ssr-feedback-submit:disabled { opacity: .65; cursor: wait; }

.ssr-feedback-status { min-height: 1.3em; margin-top: 12px; font-size: .86em; }
.ssr-feedback-status.is-error { color: #b32d2e; }
.ssr-feedback-status.is-success,
.ssr-feedback-complete { color: #166534; }
.ssr-feedback-complete { margin-top: 8px; font-family: var(--ssr-feedback-form-font, Arial, sans-serif); font-size: .88em; font-weight: 600; }
.ssr-feedback-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

@media (max-width: 640px) {
    .ssr-feedback-modal { padding: 12px; }
    .ssr-feedback-dialog { max-height: 92vh; border-radius: 12px; }
    .ssr-feedback-header { padding: 20px 52px 14px 20px; }
    .ssr-feedback-form { padding: 18px 20px 22px; }
    .ssr-feedback-fields { grid-template-columns: 1fr; }
    .ssr-feedback-footer { align-items: stretch; flex-direction: column; }
    .ssr-feedback-actions { width: 100%; }
    .ssr-feedback-cancel, .ssr-feedback-submit { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ssr-feedback-dialog { animation: none; }
    .ssr-feedback-toggle { transition: none; }
}
