/* Christmas Toolbox: shared festive styling, using the supplied v2 brand. */
body.christmas-theme {
    --bs-primary: #b81d36;
    --bs-primary-rgb: 184, 29, 54;
    --bs-success: #216347;
    --bs-success-rgb: 33, 99, 71;
    --bs-link-color: #1b6245;
    --bs-link-hover-color: #a51a30;
    --berry: #bc2038;
    --evergreen: #103e2c;
    --evergreen-2: #1f6245;
    --gold: #ffe6a3;
    --ink: #24392e;
    font-family: "Red Hat Display", system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(ellipse at 0 15%, #d4e8d8 0, transparent 38%),
        radial-gradient(ellipse at 100% 70%, #fce6df 0, transparent 34%),
        radial-gradient(circle at 12px 12px, #ffffffc4 2px, transparent 3px) 0 0 / 42px 42px,
        linear-gradient(160deg, #f8fbf4, #fff9ee 55%, #edf6f1);
}
.christmas-theme main { position: relative; min-width: 0; }
.christmas-theme h1, .christmas-theme .brand-script { color: #174d35; }
.christmas-theme h1 { line-height: 1.15; }
.christmas-theme a:focus-visible, .christmas-theme button:focus-visible { outline: 3px solid #d7a233; outline-offset: 4px; }

/* Evergreen garland, warm lights and a candy-cane edge. */
.christmas-theme .festive-navbar {
    position: relative;
    padding: 1.15rem 0 .9rem;
    background: linear-gradient(120deg, #092d20, #155039 68%, #0d3728) !important;
    border-bottom: 4px solid transparent;
    border-image: repeating-linear-gradient(125deg, #fff7e7 0 10px, #bf2338 10px 20px) 4;
    box-shadow: 0 6px 24px #153e2629;
}
.festive-navbar::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 17px; pointer-events: none;
    background: radial-gradient(ellipse at 25% 0, #2e7246 0 36%, transparent 38%) 0 0 / 38px 24px,
                radial-gradient(ellipse at 80% 0, #204e32 0 42%, transparent 44%) 0 0 / 45px 22px;
}
.fairy-lights { position: absolute; top: 1px; left: 3%; right: 3%; display: flex; justify-content: space-between; pointer-events: none; }
.fairy-lights span { width: 7px; height: 11px; border-radius: 35% 35% 50% 50%; background: #ffda82; box-shadow: 0 0 9px 3px #ffd77d60; transform: rotate(9deg); }
.fairy-lights span:nth-child(3n) { background: #f87879; box-shadow: 0 0 9px 3px #ed77775c; transform: rotate(-9deg); }
.fairy-lights span:nth-child(3n+2) { background: #a6e6bc; box-shadow: 0 0 9px 3px #a6e6bc50; }
.festive-brand { display: flex; align-items: center; gap: .65rem; margin-right: 1rem; min-width: 0; }
.festive-brand img { flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain; }
.festive-brand span { font-size: 1.2rem; line-height: 1.1; letter-spacing: -.3px; }
.festive-brand strong { display: block; color: #ffe5a2; }
.festive-brand small { display: block; font-size: .65rem; letter-spacing: .02em; margin-top: .3rem; color: #e1eee4; font-weight: 400; }
.festive-navbar .nav-link { border-radius: .55rem; font-size: .92rem; padding: .65rem .7rem !important; }
.festive-navbar .nav-link:hover, .festive-navbar .nav-link[aria-current="page"] { background: #ffffff17; color: #ffe5a2 !important; }
.festive-navbar .navbar-toggler { min-height: 44px; min-width: 44px; border: 1px solid #ffffff50; border-radius: .7rem; }
.festive-navbar .navbar-toggler-icon { animation: none; }

/* A snowy North Pole backdrop for the home page. */
.christmas-theme .hero-christmas {
    overflow: hidden;
    background: radial-gradient(ellipse at 88% 14%, #2a785063, transparent 48%),
                radial-gradient(circle at 25px 25px, #ffffff0c 2px, transparent 3px) 0 0 / 58px 58px,
                linear-gradient(140deg, #103e2c, #185b3d 62%, #103e2c);
}
.christmas-theme .hero-christmas::after { animation: none; opacity: .5; }
.christmas-theme .hero-christmas .brand-script { color: #ffedbe; text-shadow: 0 2px 0 #062f24; }
.brand-hero-art { position: relative; display: grid; justify-items: center; padding: .5rem .5rem 1.5rem; isolation: isolate; }
.brand-hero-art::before { content: ""; position: absolute; inset: 7% 2% 16%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, #fff4d827, #fff4d807 62%, transparent 64%); }
.hero-brand-logo { width: min(100%, 420px); height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 12px 18px #072f2659); }
.hero-brand-note { text-align: center; font-size: .8rem; color: #fff1d1; letter-spacing: .03em; }
.christmas-theme .hero-christmas .feature-tile { background: #fffaf1; border-color: #f7e5bd; }

/* Snow caps and peppermint details stay outside the clickable text. */
.christmas-theme .btn { border-radius: .7rem; min-height: 44px; font-weight: 600; position: relative; transition: background-color .15s, box-shadow .15s, transform .15s; }
/* Snow caps now live in magic.css (settled snow with drips). */
.christmas-theme .btn-primary, .christmas-theme .btn-danger, .christmas-theme .btn-holly {
    --bs-btn-bg: #b81d36; --bs-btn-border-color: #b81d36; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #9f172e; --bs-btn-hover-border-color: #9f172e;
    --bs-btn-active-bg: #8d1528; --bs-btn-active-border-color: #8d1528;
    --bs-btn-disabled-bg: #b81d36; --bs-btn-disabled-border-color: #b81d36;
    color: #fff; background: linear-gradient(#cd2b41, #ad192f); border: 1px solid #a51a30; box-shadow: 0 3px 0 #771325;
}
.christmas-theme .btn-primary:hover, .christmas-theme .btn-danger:hover, .christmas-theme .btn-holly:hover { color: #fff; background: #9f172e; filter: none; }
.christmas-theme .btn-outline-primary { --bs-btn-active-bg: #1d6246; --bs-btn-active-border-color: #1d6246; color: #18543b; background: #fffaf1; border-color: #96b59f; }
.christmas-theme .btn-outline-primary:hover { color: #fff; background: #1d6246; border-color: #1d6246; }
.christmas-theme .btn-outline-secondary { --bs-btn-active-bg: #216347; --bs-btn-active-border-color: #216347; color: #34523e; border-color: #b3c4b4; background: #fffdf7; }
.christmas-theme .btn-outline-secondary:hover { color: #fff; background: #345e45; border-color: #345e45; }
.christmas-theme .btn-outline-light:hover { color: #143f2b; background: #fff8e9; }
.christmas-theme .btn-check:checked + .btn { background: #216347; border-color: #216347; color: #fff; }
.christmas-theme .btn-link { color: #9e2539; box-shadow: none; }
.christmas-theme .btn:active { transform: translateY(1px); }
.christmas-theme .btn:disabled { transform: none; }

/* Cards feel like decorated stationery; forms remain easy to read. */
.christmas-theme .card { border-color: #dfe7d7; border-radius: 1rem; }
.christmas-theme .card-christmas { position: relative; background: #fffdf8f7; border: 1px solid #dce5d7; border-radius: 1.35rem; box-shadow: 0 12px 28px #214d2a12; }
.christmas-theme .card-christmas::before { content: ""; position: absolute; top: 0; left: 22px; right: 22px; height: 4px; border-radius: 0 0 4px 4px; background: repeating-linear-gradient(125deg, #c22a3e 0 9px, #fff5e5 9px 18px, #276547 18px 27px, #fff5e5 27px 36px); pointer-events: none; }
.christmas-theme .card-footer { background: #f5f7ec; border-top-color: #dfe7d7; }
.christmas-theme .feature-tile { background: #fffaf1; border-color: #dedfc4; border-top: 3px solid #b32138; }
.christmas-theme .feature-tile i { color: #226044; }
.christmas-theme .form-control, .christmas-theme .form-select { border-color: #bacbb8; border-radius: .7rem; background-color: #fffefa; min-height: 44px; color: #24392e; }
.christmas-theme .form-control:focus, .christmas-theme .form-select:focus { border-color: #397952; box-shadow: 0 0 0 .2rem #39795225; }
.christmas-theme .form-label { color: #34513b; font-weight: 600; }
.christmas-theme .form-check-input:checked { background-color: #b32138; border-color: #b32138; }
.christmas-theme .form-range::-webkit-slider-thumb { background: #b32138; }
.christmas-theme .form-range::-moz-range-thumb { background: #b32138; }
.christmas-theme .form-range::-webkit-slider-runnable-track { background: #e3ead6; }
.christmas-theme .progress { background: #e7ecd8; }
.christmas-theme .progress-bar { background: repeating-linear-gradient(125deg, #b32138 0 12px, #d14a5c 12px 24px); }
.christmas-theme .badge.bg-primary, .christmas-theme .badge.bg-secondary { background: #216347 !important; }
.christmas-theme .badge.bg-danger-subtle { background: #f6dadd !important; color: #7e1728 !important; border-color: #ecc0c8; }
.christmas-theme .alert { border-radius: .85rem; }
.christmas-theme .alert-warning { background: #fff3d0; border-color: #e9ce82; color: #654d17; }
.christmas-theme .modal-content { border-radius: 1.2rem; border-color: #d3dfc8; }
.christmas-theme .modal-header { border-bottom: 3px solid #e9ddbc; }
.christmas-theme .modal-footer { background: #f7f9f0; }
.christmas-theme .modal-content.bg-dark .modal-footer { background: #152d24; }
.christmas-theme #loadingOverlay .loader-box { background: #fffcf2; border: 2px solid #dfc689; }
.christmas-theme .spinner-border { color: #b32138; }
.christmas-theme .placeholder-chip { background: #eef4e9; color: #245a3c; border-color: #b8ccaf; }
.christmas-theme .letter-step-controls { background: #fffdf8; }
.christmas-theme .template-card .thumb { background: #f7f5e9; }
.christmas-theme .writing-choice { background: #fffefa; }
.christmas-theme .btn-check:checked + .writing-choice { background: #f1f7e9; }
.christmas-theme .letter-flow-nav li.is-current span { background: #b32138; box-shadow: 0 0 0 4px #f7dfe1; }
.christmas-theme .advent-door { background: #fffaf1; color: #1c553b; border-color: #b8c8a8; box-shadow: 0 3px 0 #d4ddc2; }
.christmas-theme .advent-door:not(.is-locked):hover { background: #f7e6ba; }

.christmas-theme .festive-footer { position: relative; background: linear-gradient(110deg, #0a3224, #164b34) !important; border-top: 5px solid #e4c980; padding: 1.25rem 0; }
.footer-content { display: flex; align-items: center; gap: 1.5rem; }
.footer-brand { flex: 0 0 128px; }
.footer-brand img { width: 128px; height: 128px; object-fit: contain; }
.footer-message { flex: 1; color: #fff4d9; }
.footer-message p { font-weight: 700; }
.footer-message small { color: #d1e2d4; font-size: .8rem; }
.footer-actions { display: flex; align-items: center; gap: 1rem; font-size: .8rem; }
.snow-toggle { white-space: nowrap; min-width: 100px; }

.festive-snow { position: fixed; inset: 0; overflow: hidden; z-index: 40; pointer-events: none; }
.festive-snow[hidden] { display: none; }
.festive-snow span { position: absolute; top: -30px; color: #fff; opacity: .72; text-shadow: 0 1px 2px #37674738; animation: festive-fall var(--duration, 15s) linear var(--delay, 0s) infinite; font-size: var(--size, 13px); left: var(--left, 50%); }
@keyframes festive-fall { from { transform: translate3d(0, -30px, 0) rotate(0); } to { transform: translate3d(var(--drift, 35px), 105dvh, 0) rotate(125deg); } }
@media (max-width: 575.98px) {
    .festive-brand img { width: 48px; height: 48px; flex-basis: 48px; }
    .festive-brand span { font-size: 1.04rem; }
    .festive-brand small { display: none; }
    .festive-navbar .container { flex-wrap: wrap; }
    .hero-brand-logo { width: min(100%, 300px); }
    .brand-hero-art { padding-top: 0; }
    .hero-brand-note { max-width: 260px; }
    .footer-content { flex-wrap: wrap; gap: .85rem; }
    .footer-brand { flex-basis: 88px; }
    .footer-brand img { width: 88px; height: 88px; }
    .footer-message { flex-basis: calc(100% - 105px); }
    .footer-actions { flex-basis: 100%; justify-content: space-between; padding-top: .4rem; }
    .christmas-theme .btn-group .btn { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
    .festive-snow { display: none !important; }
    .christmas-theme *, .christmas-theme *::before, .christmas-theme *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
    .festive-navbar, .festive-footer, .festive-snow, .fairy-lights { display: none !important; }
    .christmas-theme { background: #fff !important; }
    .christmas-theme .card, .christmas-theme .card-christmas { box-shadow: none; }
    .christmas-theme .card-christmas::before, .christmas-theme .btn::before { display: none; }
}

/* Older standalone routes share the same branding. */
.legacy-page .card { background: #fffdf7; color: #24392e; }
.legacy-page .logo { width: 150px; max-width: 50vw; height: auto; }
.legacy-page .navbar { background: #103e2c !important; }

/* A clear, shared delivery flow for every printable creation. */
.christmas-theme .btn-santa-email {
    flex: 1 0 100%; min-height: 50px; white-space: normal;
    background: linear-gradient(#28754f, #17583a); border-color: #17583a;
    box-shadow: 0 3px 0 #0c3522; color: #fff; font-size: 1rem;
}
.christmas-theme .btn-santa-email:hover { background: #154e34; color: #fff; }
.santa-email-panel { padding: 1.25rem; border: 2px solid #b9cfab; border-top: 5px solid #cead55; border-radius: 1rem; background: #f5faef; }
.santa-email-heading { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1rem; }
.santa-email-heading img { flex: 0 0 48px; width: 48px; height: 48px; object-fit: contain; }
.santa-email-heading h2 { color: #164c32; }
.santa-email-heading p { color: #3e5945; }
.email-format-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.email-format-chips span { padding: .35rem .55rem; border-radius: .5rem; background: #fffdf5; border: 1px solid #d6dfc3; color: #2f563d; font-size: .8rem; font-weight: 700; }
.email-delivery-status:not(:empty) { padding: .8rem; border-radius: .6rem; border: 1px solid #cbd7bb; background: #fffdf5; }
.email-delivery-status.is-success { color: #164c32; background: #e6f2df; border-color: #aac899; }
.email-delivery-status.is-error { color: #8e1b2c; background: #fff0ee; border-color: #e3b9bd; }
#genericEmailDelivery { max-width: 720px; }
#genericEmailDelivery[hidden] { display: none !important; }
.generic-email-copy { color: #244d33; }
@media (max-width: 575.98px) {
    .santa-email-panel { padding: 1rem; }
    .santa-email-heading { gap: .5rem; }
    .santa-email-heading img { flex-basis: 40px; width: 40px; height: 40px; }
    .santa-email-panel .btn { min-height: 48px; }
}
.christmas-theme .letter-actions .btn-santa-email { flex: 1 0 100%; }
.js-letter-flow body:not(.letter-show-preview) .letter-studio #emailForm { display: none; }
