/* ==========================================================================
   Cookie consent banner + preferences dialog
   devotees.yssofindia.org

   Self-contained on purpose. Every class is prefixed yssc- so nothing here
   collides with the Elementor-derived styles the portal footer carries, and
   nothing depends on Bootstrap or jQuery being loaded.
   ========================================================================== */

.yssc-banner,
.yssc-banner *,
.yssc-overlay,
.yssc-overlay * { box-sizing: border-box; }

/* ---------- bottom bar ---------- */

.yssc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;
    background: #444444;
    color: #ffe4c6;
    border-top: 3px solid #f49019;
    padding: 18px 22px;
    font-family: Raleway, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    box-shadow: 0 -2px 18px rgba(0, 0, 0, .18);
    display: none;
}

.yssc-banner.is-open { display: block; }

.yssc-banner-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 26px;
}

.yssc-banner-text { flex: 1 1 380px; min-width: 0; margin: 0; }
.yssc-banner-text a { color: #ffac0a; text-decoration: underline; }

.yssc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 0 0 auto;
    align-items: center;
}

/* Accept and Reject share shape, size, weight AND fill treatment - only the
   hue differs. An earlier draft gave Accept a solid fill and Reject an outline;
   that is the pattern the EDPB and CNIL have criticised, because a solid button
   beside a thin outline nudges toward consent however identical the text is.
   DPDP requires withdrawing consent to be as easy as giving it, so neither
   button gets the visual advantage. */
.yssc-btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.yssc-btn-accept {
    background: #f49019;
    border-color: #f49019;
    color: #000000;
}
.yssc-btn-accept:hover { background: #f6a509; border-color: #f6a509; }

.yssc-btn-reject {
    background: #a5a5a5;
    border-color: #a5a5a5;
    color: #000000;
}
.yssc-btn-reject:hover { background: #888888; border-color: #888888; }

.yssc-btn-manage {
    background: none;
    border: 0;
    color: #ffac0a;
    text-decoration: underline;
    padding: 9px 6px;
    font-weight: 500;
}
.yssc-btn-manage:hover { color: #ffe4c6; }

.yssc-btn:focus-visible,
.yssc-link:focus-visible,
.yssc-switch input:focus-visible + .yssc-slider {
    outline: 2px solid #ffac0a;
    outline-offset: 2px;
}

/* ---------- preferences dialog ---------- */

.yssc-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 99991;
    background: rgba(0, 0, 0, .5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.yssc-overlay.is-open { display: flex; }

.yssc-dialog {
    background: #fff;
    color: #444444;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 5px;
    padding: 26px 28px;
    font-family: Raleway, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

.yssc-dialog h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #444444;
}

.yssc-dialog-intro { margin: 0 0 20px; color: #555; }
/* On the white dialog the bar's #ffac0a is unreadable (1.9:1). #bb4f27 is the
   footer palette's deep rust and clears AA at 5.6:1 while staying warm. */
.yssc-dialog-intro a { color: #bb4f27; text-decoration: underline; }
.yssc-dialog-intro a:hover { color: #e46516; }

.yssc-group {
    border-top: 1px solid #eeeeee;
    padding: 16px 0;
    display: flex;
    gap: 18px;
    align-items: flex-start;
}
.yssc-group:last-of-type { border-bottom: 1px solid #eeeeee; }

.yssc-group-body { flex: 1 1 auto; min-width: 0; }
.yssc-group-title { font-weight: 700; margin: 0 0 3px; }
.yssc-group-desc { margin: 0; color: #666; font-size: 13px; }

.yssc-always {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: #12326b;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-top: 4px;
}

/* toggle */
.yssc-switch { flex: 0 0 auto; position: relative; width: 46px; height: 26px; }
.yssc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}
.yssc-slider {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: #a5a5a5;
    border-radius: 26px;
    transition: background-color .15s ease;
    pointer-events: none;
}
.yssc-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s ease;
}
.yssc-switch input:checked + .yssc-slider { background: #12326b; }
.yssc-switch input:checked + .yssc-slider::before { transform: translateX(20px); }

.yssc-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    justify-content: flex-end;
}

.yssc-btn-save {
    background: #444444;
    border-color: #444444;
    color: #fff;
}
.yssc-btn-save:hover { background: #000000; border-color: #000000; }

/* footer re-open link */
.yssc-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 640px) {
    .yssc-banner { padding: 15px 16px; font-size: 13.5px; }
    .yssc-actions { width: 100%; }
    .yssc-actions .yssc-btn-accept,
    .yssc-actions .yssc-btn-reject { flex: 1 1 auto; text-align: center; }
    .yssc-dialog { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .yssc-btn, .yssc-slider, .yssc-slider::before { transition: none; }
}
