
:root {
    --text-color-weak: #666666;
    --text-color-normal: #000;
    --text-color-strong: #000;
    --background-color-weaker: #f5f5f5;
    --background-color-weak: #efefef;
    --background-color-normal: #fff;
    --background-color-strong: #cccccc;

    --color-primary: #187693;
    --color-primary-hover: #2894b4;
    --color-primary-stronger: #11586e;

    --btn-primary-background-color: #11586e;
    --btn-primary-background-color-hover: #177c9b;

    /* --color-primary: #437b8d;
    --color-primary-hover: #7ba3af; */

    --color-on-primary-background: #ffffff;
}
body {
    /* font-family: 'Open Sans', sans-serif; */
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--text-color-normal);
    margin: 0;
    background-color: var(--background-color-weaker);
}
header {
    margin-bottom: 36px;
    background-color: var(--background-color-normal);
    color: var(--color-primary-stronger);
    box-shadow: 0 8px 12px 0 rgb(0 0 0 / 5%);
}
header .header {
    border-bottom: 4px solid var(--color-primary);
}
header .header-inner {
    max-width: 1200px;
    min-height: 56px;
    margin: 0 auto;
    padding: 8px 12px;
}
header img {
    max-height: 3em;
}
header h1 {
    margin: 0;
    font-size: 1.6rem;
}
main.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
    margin-bottom: 48px;
}
.search-input-section {
    margin-bottom: 48px;
}
@media all and (min-width: 600px) {
    header .header-inner {
        display: flex;
        gap: 1em;
        align-items: center;
        padding: 8px 24px;
    }
    main.page-container {
        padding: 0 24px;
    }
}
@media (min-width: 800px) {
    header {
        position: sticky;
        top: 0;
    }
    main.page-container--index {
        display: grid;
        grid-template-columns: 300px 1fr;
        grid-gap: 24px;
    }
    .search-input-section form {
        position: sticky;
        top: calc(60px + 36px);
    }
}

.livesearch-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.livesearch-list-element:not(:last-child) {
    margin-bottom: 8px;
}

.search-result-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.search-result-section li {
    margin-bottom: 24px;
    padding-bottom: 24px;
}
.search-result-section li:not(:last-child) {
    border-bottom: 2px solid var(--background-color-weak);
}
.search-result-section a {
    text-decoration: none;
    color: inherit;
}
.search-result-section a:hover {
    text-decoration: underline;
}

.form-field {
    position: relative;
    margin-bottom: 18px;
}
.search-field-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
}
input.search-field {
    border-radius: 8px;
    height: 40px;
    padding-right: 12px;
    padding-left: 12px;
    border: 2px solid var(--background-color-weak);
    box-shadow: none;
    color: var(--text-color-normal);
    font-size: 16px;
    font-style: normal;
    width: 100%;
    box-sizing: border-box;
}
input.search-field:hover {
    border-color: var(--color-primary-hover);
}
input.search-field:active {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
input.search-field:focus-visible {
    outline: var(--color-primary) auto 1px;
}
input[type=submit] {
    border: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: initial;
    min-width: 160px;
    text-transform: uppercase;
    border-radius: 20px;
    color: var(--color-on-primary-background);
    background: var(--btn-primary-background-color);

    padding: 10px 20px 8px;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.4;
    letter-spacing: .8;
}
input[type=submit]:hover, input[type=submit]:focus {
    background: var(--btn-primary-background-color-hover);
}
.search-result-item {
    display: flex;
    align-items: center;
}
.search-result-item__owner {
    color: var(--text-color-weak);
    font-weight: 300;
}

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
a.page-link {
    color: var(--color-primary);
}
.page-link--right {
    margin-left: auto;
}


table.nlf-table {
    width: 100%;
    border-collapse: collapse;
}

.nlf-table__cell {
    border-top: 1px solid #000;
    line-height: 1.1;
    padding: 0.75em 0;
    text-align: left;
}

.nlf-table__cell--header {
    font-size: 0.8em;
    font-weight: normal;
    padding: 0.75em 0;
    text-align: left;
    text-transform: uppercase;
}

.nlf-table__cell--right {
    text-align: right;
}

/* Lisensbevis */

.nlf-licenses h1,
.nlf-licenses h2,
.nlf-licenses h3,
.nlf-licenses h4,
.nlf-licenses p {
    margin: 0;
}

.nlf-licenses__header {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.nlf-licenses__header p {
    margin: 0.25em 0;
    line-height: 1.4;
}

h2.nlf-licenses__heading {
    margin-top: 0.75em;
    margin-bottom: 0.25em;
    font-weight: normal;
}

.nlf-licenses__ul {
    margin: 0;
    padding: 0;
}

.nlf-licenses__li {
    border-top: 1px solid #000;
    list-style-type: none;
    padding: 0.5em 0;
}
.nlf-licenses__li:first-child {
    border-top: 0;
}

.nlf-licenses__qr img {
    max-width: 100%;
    object-fit: contain;
    height: auto;
}

.nlf-licenses__logos {
    display: flex;
    gap: 1em;
    padding: 3em 0 1em;
    max-width: 100%;
}
.nlf-licenses__logos img {
    height: auto;
    max-height: 140px;
    max-width: 100%;
}

/* IPPI Badge styling */
.nlf-licenses__ippi-badges {
    display: flex;
    flex-direction: row;
    gap: 1em;
    align-items: center;
    order: 2;  /* Position between holder info and QR code */
}
.nlf-licenses__ippi-badge img {
    height: 185px;
    width: auto;
}

.nlf-license__print-date {
    display: none;
}

/* Wallet card link in header */
.wallet-card-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    margin-left: auto;
}

.wallet-card-link:hover {
    text-decoration: underline;
}

/* Tab styling */
.nlf-licenses__tab-input {
    display: none;
}

.nlf-licenses__tab-buttons {
    display: flex;
    border-bottom: 2px solid #187693;
    gap: 0;
    margin-bottom: 1em;
    margin-top: 1em;
}

.nlf-licenses__tab-button {
    padding: 0.75em 1.5em;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-bottom: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    margin-right: -1px;
}

.nlf-licenses__tab-button:hover {
    background-color: #e0e0e0;
}

.nlf-licenses__tab-button:first-of-type {
    border-top-left-radius: 4px;
}

.nlf-licenses__tab-button:last-of-type {
    border-top-right-radius: 4px;
}

/* Active tab styling */
#tab-1:checked ~ .nlf-licenses__tab-buttons label[for="tab-1"],
#tab-2:checked ~ .nlf-licenses__tab-buttons label[for="tab-2"],
#tab-3:checked ~ .nlf-licenses__tab-buttons label[for="tab-3"],
#tab-4:checked ~ .nlf-licenses__tab-buttons label[for="tab-4"],
#tab-5:checked ~ .nlf-licenses__tab-buttons label[for="tab-5"],
#tab-6:checked ~ .nlf-licenses__tab-buttons label[for="tab-6"],
#tab-7:checked ~ .nlf-licenses__tab-buttons label[for="tab-7"],
#tab-8:checked ~ .nlf-licenses__tab-buttons label[for="tab-8"] {
    background-color: #187693;
    color: white;
    border-color: #187693;
}

/* Section page visibility controlled by tabs */
.nlf-licenses__section-page {
    display: none;
}

#tab-1:checked ~ .nlf-licenses__section-page[data-section="1"],
#tab-2:checked ~ .nlf-licenses__section-page[data-section="2"],
#tab-3:checked ~ .nlf-licenses__section-page[data-section="3"],
#tab-4:checked ~ .nlf-licenses__section-page[data-section="4"],
#tab-5:checked ~ .nlf-licenses__section-page[data-section="5"],
#tab-6:checked ~ .nlf-licenses__section-page[data-section="6"],
#tab-7:checked ~ .nlf-licenses__section-page[data-section="7"],
#tab-8:checked ~ .nlf-licenses__section-page[data-section="8"] {
    display: block;
}

.nlf-licenses__section-title h2 {
    color: #187693;
    font-size: 1.5em;
    margin: 1em 0 0.5em;
    border-bottom: 2px solid #187693;
    padding-bottom: 0.25em;
}

.nlf-licenses__section-description {
    color: #666;
    font-style: italic;
    margin-bottom: 1em;
}

@media all and (min-width: 600px) {
    .nlf-licenses__title {
        margin-left: auto;
    }
    .nlf-licenses__header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
    /* QR code on the right */
    .nlf-licenses__header .nlf-licenses__qr {
        order: 10;
    }
    .nlf-licenses__logos {
        gap: 2em;
    }
}

/* Hide print-only elements on screen */
.print-only {
    display: none;
}

@media print {
    body {
        font-size: 0.8em;
        background-color: white !important;
    }

    header,
    .nlf-licenses__tab-button,
    .nlf-licenses__section-page,
    main.page-container {
        background-color: transparent !important;
    }

    /* Hide the page header - each section will show its own header */
    header {
        display: none !important;
    }

    /* Show print-only elements */
    .print-only {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 1em;
        padding-bottom: 0.5em;
        margin-bottom: 1em;
        border-bottom: 2px solid #187693;
    }

    .print-only .nlf-licenses__title {
        margin-left: auto !important;
    }

    main.page-container {
        padding: 0;
        margin: 0;
    }

    /* Hide tabs in print */
    .no-print,
    .nlf-licenses__tab-buttons,
    .nlf-licenses__tab-input {
        display: none !important;
    }

    /* Each section page gets its own print page */
    .nlf-licenses__section-page {
        display: block !important;
        page-break-inside: avoid;
        page-break-before: always;
        page-break-after: always;
    }

    /* First section: no page break before */
    .nlf-licenses__section-page--first {
        page-break-before: avoid;
    }

    /* Last section: no page break after */
    .nlf-licenses__section-page:last-child {
        page-break-after: avoid;
    }

    /* Header styling for print */
    .nlf-licenses__header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 1em;
    }

    .nlf-licenses__qr {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
        order: 10;
    }

    .nlf-licenses__header > div:not(.nlf-licenses__qr):not(.nlf-licenses__ippi-badges) {
        flex: 1;
    }

    /* Logos and footer */
    .nlf-licenses__logos {
        page-break-before: avoid;
        page-break-inside: avoid;
    }

    .nlf-licenses__logos img {
        max-height: 80px;
    }

    /* IPPI badges in print */
    .nlf-licenses__ippi-badges {
        page-break-before: avoid;
        page-break-inside: avoid;
    }
    .nlf-licenses__ippi-badge img {
        max-height: 120px;
        max-width: 140px;
    }

    .nlf-license__print-date {
        display: block;
        font-size: 0.8em;
        color: red;
    }
}