/* Edition 1, version 4: illuminated card screens, classic light/dark reading pages. */
.asva-theme-switch {
    display: inline-flex;
    height: 36px;
    padding: 3px;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 6px;
    background: rgba(4, 15, 61, .28);
    box-sizing: border-box;
}

.asva-theme-switch button {
    display: inline-grid;
    width: 30px;
    height: 28px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 4px;
    color: rgba(255, 255, 255, .53);
    background: transparent;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .35s ease;
}

.asva-theme-switch button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.asva-theme-switch button:hover,
.asva-theme-switch button:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

.asva-theme-switch button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

html[data-asva-theme="light"] .asva-theme-switch button[data-asva-theme-choice="light"],
html[data-asva-theme="dark"] .asva-theme-switch button[data-asva-theme-choice="dark"] {
    color: #10205e;
    background: #f2b72d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

html[data-asva-theme="light"] .asva-theme-switch button[data-asva-theme-choice="light"] {
    box-shadow: 0 0 0 1px rgba(255, 226, 151, .42), 0 0 18px rgba(255, 220, 128, .58);
}

/* Card screens use the same dark corporate colours. The sun only adds light. */
html[data-asva-theme] body {
    transition: color .45s ease, background-color .45s ease;
}

html[data-asva-theme="light"] body {
    color: #24344d;
    background: #f4f7fc;
}

html[data-asva-theme="light"] body.asva-home-page {
    color: #e2eaf6;
    background: #101b2c;
}

html[data-asva-theme="light"] .asva-home-page .asva-home-screen {
    background-color: #07121d !important;
}

/* A large, soft source in the upper-right corner lights the background. */
.asva-home-page .asva-home-screen::after {
    content: "";
    position: fixed;
    z-index: 2;
    inset: 0;
    background:
        radial-gradient(ellipse 76% 68% at 104% -5%, rgba(255, 247, 213, .26) 0%, rgba(178, 211, 255, .13) 27%, rgba(105, 159, 224, .05) 49%, transparent 69%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .55s ease;
}

html[data-asva-theme="light"] .asva-home-page .asva-home-screen::after {
    opacity: 1;
}

/* Header and navigation receive the same directional highlight. */
.asva-site-header {
    isolation: isolate;
}

.asva-site-header::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: linear-gradient(112deg, transparent 48%, rgba(168, 207, 255, .08) 73%, rgba(255, 244, 199, .22) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease;
}

.asva-header-inner {
    position: relative;
    z-index: 1;
}

html[data-asva-theme="light"] .asva-site-header::after {
    opacity: 1;
}

html[data-asva-theme="light"] .asva-top-menu a {
    border-color: rgba(255, 255, 255, .28) !important;
    color: #fff !important;
    background: rgba(255, 255, 255, .08) !important;
    box-shadow:
        inset -1px 1px 0 rgba(255, 255, 255, .18),
        5px -5px 16px rgba(218, 235, 255, .06),
        -5px 7px 14px rgba(3, 10, 40, .18);
}

html[data-asva-theme="light"] .asva-top-menu a:hover,
html[data-asva-theme="light"] .asva-top-menu a:focus-visible {
    border-color: #f2b72d !important;
    color: #f2b72d !important;
    background: rgba(255, 255, 255, .14) !important;
}

/* The services rail keeps its blue night colour and catches the light. */
.asva-service-sidebar {
    isolation: isolate;
}

.asva-service-sidebar::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 246, 207, .22), rgba(154, 200, 255, .09) 25%, transparent 54%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease;
}

.asva-service-sidebar > * {
    position: relative;
    z-index: 1;
}

html[data-asva-theme="light"] .asva-service-sidebar::before {
    opacity: 1;
}

html[data-asva-theme="light"] .asva-service-sidebar {
    border-color: rgba(255, 255, 255, .28) !important;
    color: #fff !important;
    background: rgba(15, 36, 115, .88) !important;
    box-shadow:
        10px -10px 28px rgba(218, 235, 255, .08),
        -10px 16px 35px rgba(3, 10, 40, .36),
        inset -1px 1px 0 rgba(255, 255, 255, .18);
}

html[data-asva-theme="light"] .asva-service-sidebar__head {
    border-color: rgba(255, 255, 255, .17) !important;
    background: rgba(15, 36, 115, .94) !important;
}

html[data-asva-theme="light"] .asva-service-sidebar__title,
html[data-asva-theme="light"] .asva-service-sidebar__label {
    color: #fff !important;
}

html[data-asva-theme="light"] .asva-service-sidebar__toggle {
    border-color: rgba(255, 255, 255, .34) !important;
    color: #fff !important;
    background: rgba(255, 255, 255, .10) !important;
}

html[data-asva-theme="light"] .asva-service-sidebar__links a {
    border-color: rgba(255, 255, 255, .20) !important;
    color: #fff !important;
    background: rgba(25, 52, 139, .78) !important;
    box-shadow: inset -1px 1px 0 rgba(255, 255, 255, .14);
}

html[data-asva-theme="light"] .asva-service-sidebar__links a:hover,
html[data-asva-theme="light"] .asva-service-sidebar__links a:focus-visible,
html[data-asva-theme="light"] .asva-service-sidebar__links a.is-asva-active-service {
    border-color: rgba(242, 183, 45, .82) !important;
    background: rgba(37, 69, 164, .96) !important;
}

html[data-asva-theme="light"] .asva-service-sidebar__number {
    color: #f2b72d;
    border-color: rgba(242, 183, 45, .78);
}

/* Card light layers fade in and out while the base colours stay unchanged. */
.asva-feature-card::before {
    opacity: 0;
    transition: opacity .5s ease;
}

html[data-asva-theme="light"] .asva-feature-card::before {
    background:
        radial-gradient(circle at 100% 0, rgba(255, 247, 213, .30), rgba(167, 207, 255, .11) 27%, transparent 56%),
        linear-gradient(135deg, transparent 48%, rgba(202, 225, 255, .055) 76%, rgba(255, 247, 213, .11));
    opacity: 1;
}

.asva-service-switch-card::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 247, 213, .28), rgba(167, 207, 255, .10) 27%, transparent 56%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease;
}

html[data-asva-theme="light"] .asva-service-switch-card::before {
    opacity: 1;
}

html[data-asva-theme="light"] .asva-center-card.asva-feature-card,
html[data-asva-theme="light"] .asva-service-switch-card {
    border-color: rgba(255, 255, 255, .34) !important;
    color: #fff !important;
    background:
        radial-gradient(circle at 0 0, rgba(255, 255, 255, .08), transparent 44%),
        linear-gradient(145deg, rgba(82, 86, 92, .96), rgba(58, 62, 68, .96)) !important;
    box-shadow:
        11px -11px 30px rgba(220, 237, 255, .10),
        -12px 17px 36px rgba(0, 0, 0, .36),
        inset -1px 1px 0 rgba(255, 255, 255, .20) !important;
}

html[data-asva-theme="light"] .asva-feature-card__content h2,
html[data-asva-theme="light"] .asva-service-switch-card h2 {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .34) !important;
}

html[data-asva-theme="light"] .asva-feature-card__content p,
html[data-asva-theme="light"] .asva-service-switch-card p {
    color: rgba(222, 229, 233, .92) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .30) !important;
}

html[data-asva-theme="light"] :is(.asva-feature-card__number, .asva-feature-card__icon, .asva-service-switch-card__number, .asva-service-switch-card__icon) {
    color: #f2b72d;
}

html[data-asva-theme="light"] :is(.asva-feature-card__icon, .asva-service-switch-card__icon) {
    border-color: rgba(242, 183, 45, .62);
}

html[data-asva-theme="light"] :is(.asva-feature-card__art, .asva-service-switch-card__art) {
    color: #3b95b2;
    opacity: .40;
}

html[data-asva-theme="light"] :is(.asva-feature-card__more, .asva-service-switch-card__more) {
    border-color: rgba(255, 255, 255, .22);
    color: #fff;
}

html[data-asva-theme="light"] :is(.asva-feature-card__more b, .asva-service-switch-card__more b) {
    color: #f2b72d;
}

html[data-asva-theme="light"] .asva-center-card.asva-feature-card:hover,
html[data-asva-theme="light"] .asva-center-card.asva-feature-card:focus-visible,
html[data-asva-theme="light"] .asva-service-switch-card:hover,
html[data-asva-theme="light"] .asva-service-switch-card:focus-visible {
    border-color: #f2b72d !important;
    background:
        radial-gradient(circle at 100% 0, rgba(242, 183, 45, .17), transparent 42%),
        linear-gradient(145deg, rgba(94, 97, 102, .98), rgba(61, 65, 70, .98)) !important;
    box-shadow:
        13px -13px 34px rgba(255, 239, 184, .12),
        -14px 20px 42px rgba(0, 0, 0, .43),
        inset 0 0 0 1px rgba(242, 183, 45, .16) !important;
}

/* Card screens stay illuminated; opened reading pages use the requested calm blue daylight. */
html[data-asva-theme="light"] body.asva-standalone-inner {
    color: #263544;
    background: linear-gradient(180deg, #dcecf9 0, #e8f2fb 280px, #e8f2fb 100%) fixed !important;
}

html[data-asva-theme="light"] body.asva-standalone-inner :is(#page-wrapper, #content-wrapper, #content, #workarea-wrapper, #workarea, #workarea-inner) {
    background-color: transparent !important;
}

html[data-asva-theme="light"] .asva-home-screen.is-asva-tariffs .asva-tariffs-view {
    color: #26323c;
    background: linear-gradient(180deg, #dcecf9 0, #e8f2fb 280px, #e8f2fb 100%) !important;
}

/* In moon mode, reading pages and the in-page detail view stay dark too. */
html[data-asva-theme="dark"] body.asva-standalone-inner {
    color: #e2eaf6;
    background: #101b2c !important;
}

html[data-asva-theme="dark"] body.asva-standalone-inner :is(#page-wrapper, #content-wrapper, #content, #workarea-wrapper, #workarea, #workarea-inner) {
    background-color: transparent !important;
}

html[data-asva-theme="dark"] .asva-home-screen.is-asva-tariffs .asva-tariffs-view {
    color: #e2eaf6;
    background: #101b2c !important;
}

html[data-asva-theme="dark"] :is(.asva-svh-article, .asva-tariffs-article, .asva-info-page, .asva-service-static, .asva-svh-landing__intro, .asva-svh-landing__note) {
    color: #e2eaf6 !important;
}

html[data-asva-theme="dark"] :is(.asva-svh-article, .asva-tariffs-article, .asva-info-page, .asva-service-static, .asva-svh-landing__intro, .asva-svh-landing__note) :is(h1, h2, h3) {
    color: #f2f6fc !important;
}

html[data-asva-theme="dark"] :is(.asva-svh-article .asva-tariffs-article__lead, .asva-tariffs-article__lead, .asva-svh-landing__intro p, .asva-svh-landing__note p) {
    color: #c4d3e5 !important;
}

html[data-asva-theme="dark"] :is(.asva-svh-article a:not(.asva-tariffs-cta), .asva-tariffs-article a:not(.asva-tariffs-cta), .asva-info-page a:not(.asva-info-button), .asva-service-static a:not(.asva-tariffs-cta)) {
    color: #f2c45d !important;
}

/* Download controls keep dark lettering on their gold background in both themes.
   The element selector intentionally matches the specificity of the link rule above. */
html[data-asva-theme="dark"] .asva-tariffs-article a.asva-resource-card__button,
html[data-asva-theme="dark"] .asva-tariffs-article a.asva-resource-card__button:hover,
html[data-asva-theme="dark"] .asva-tariffs-article a.asva-resource-card__button:focus-visible {
    color: #10205e !important;
}

html[data-asva-theme="dark"] .asva-tariffs-article a.asva-resource-card__button span {
    color: inherit !important;
}

/* Gold action buttons must retain sufficient contrast regardless of page theme. */
html[data-asva-theme] :is(.asva-header-apply, .asva-application-form__submit, .asva-operator-form__submit, .asva-callback-form__submit),
html[data-asva-theme] :is(.asva-header-apply, .asva-application-form__submit, .asva-operator-form__submit, .asva-callback-form__submit):hover,
html[data-asva-theme] :is(.asva-header-apply, .asva-application-form__submit, .asva-operator-form__submit, .asva-callback-form__submit):focus-visible {
    color: #10205e !important;
}

html[data-asva-theme="dark"] .asva-svh-article__breadcrumbs {
    color: #aebdd0;
}

html[data-asva-theme="dark"] :is(.asva-svh-article__contact, .asva-info-card, .asva-download-fallback, .asva-download-page .asva-download-list) {
    border-color: rgba(205, 221, 245, .20);
    color: #e2eaf6 !important;
    background: #1d2e47 !important;
}

html[data-asva-theme="dark"] :is(.asva-download-fallback, .asva-download-page) .asva-download-list a {
    color: #e2eaf6 !important;
}

html[data-asva-theme="dark"] :is(.asva-international-guide, .asva-customs-clearance-guide, .asva-phytosanitary-guide, .asva-veterinary-guide, .asva-responsible-storage-guide, .asva-delivery-guide) {
    color: #e2eaf6;
    background: #17253a;
}

html[data-asva-theme="dark"] :is(.asva-international-guide, .asva-customs-clearance-guide, .asva-phytosanitary-guide, .asva-veterinary-guide, .asva-responsible-storage-guide, .asva-delivery-guide) :is(h2, h3) {
    color: #f2f6fc;
}

html[data-asva-theme="dark"] :is(.asva-international-guide, .asva-customs-clearance-guide, .asva-phytosanitary-guide, .asva-veterinary-guide, .asva-responsible-storage-guide, .asva-delivery-guide) a {
    color: #f2c45d;
}

@media (max-width: 1180px) {
    .asva-header-contacts { display: none; }
}

@media (max-width: 600px) {
    :root { --asva-header-height: 116px; }

    .asva-header-inner {
        display: grid !important;
        grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
        grid-template-areas:
            "logo logo logo languages theme apply"
            "toggle login login login login login";
        grid-template-rows: 48px 38px;
        min-height: 116px;
        padding: 7px 12px;
        column-gap: 6px;
        row-gap: 6px;
    }

    .asva-header-logo { grid-area: logo; width: 145px; min-width: 0; }
    .asva-top-menu-toggle { grid-area: toggle; }
    .asva-header-login { grid-area: login; }
    .asva-header-languages { grid-area: languages; }
    .asva-theme-switch { grid-area: theme; }
    .asva-header-apply { grid-area: apply; }
    .asva-header-tools {
        display: contents !important;
        grid-column: auto;
        grid-row: auto;
        margin-left: 0;
    }
    .asva-header-contacts { display: none; }
}

@media (max-width: 360px) {
    .asva-header-logo { width: 125px; }
    .asva-theme-switch button { width: 27px; }
}

@media (prefers-reduced-motion: reduce) {
    .asva-theme-switch button { transition: none; }
}
