:root {
    --sidebar-width: 12.5%;
    --brand-color: #2b5b3e;
    --font-family: system-ui, sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-family);
}

.portal {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: 90px;
    background: #f2f2f2;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.sidebar a {
    padding: 0.5rem;
    color: var(--brand-color);
    text-decoration: none;
}

.sidebar a.active {
    font-weight: bold;
}

.lang-switcher {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.lang-switcher label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: #555;
}

.content {
    flex: 1;
    padding: 1.5rem;
}

.auth-page {
    max-width: 24rem;
    margin: 4rem auto;
    padding: 1.5rem;
}

form label {
    display: block;
    margin-bottom: 0.75rem;
}

textarea {
    width: 100%;
    font: inherit;
    box-sizing: border-box;
}

/*
 * Guest registration card (public/guest-cards.php): grouping short fields
 * 2-3 per row instead of one-per-row, since it's the longest form in the
 * app. Section headers, intro text, buttons, the save-status message, and
 * the address/contact/signature sub-groups (which lay themselves out
 * internally, below) each span the full width rather than sharing a row
 * with unrelated fields.
 */
#traveller-form fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 1rem;
    align-items: start;
}

#traveller-form fieldset > h3,
#traveller-form fieldset > p,
#traveller-form fieldset > div,
#traveller-form fieldset > button,
#traveller-form fieldset > span,
#traveller-form fieldset > label:has(input[type="radio"]) {
    grid-column: 1 / -1;
}

#ownAddressFields,
#sameAsAddressFields,
#ownContactFields,
#sameAsContactFields,
#adultSignatureFields,
#minorSignatoryFields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 1rem;
}

#ownAddressFields > p,
#sameAsAddressFields > p,
#ownContactFields > p,
#sameAsContactFields > p {
    grid-column: 1 / -1;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

th,
td {
    border: 1px solid #ccc;
    padding: 0.4rem 0.6rem;
    text-align: left;
}

tr.past {
    color: #777;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

nav.actions {
    margin-bottom: 1rem;
}

#traveller-form {
    margin-bottom: 1.5rem;
}

#traveller-form button[type="submit"] {
    margin-top: 0.5rem;
}

.actions form {
    margin: 0;
}

/*
 * Explicit box styling shared by <button> and <a class="btn"> (Edit,
 * Cancel), so both render identically — `appearance: button` alone isn't
 * enough, since it paints native chrome without the matching padding a
 * real <button> gets from the browser's own stylesheet.
 */
.btn {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border: 1px solid #767676;
    border-radius: 3px;
    background-color: #efefef;
    color: #000;
    font: inherit;
    line-height: normal;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #cfe0f7;
    border-color: #1a5fb4;
}

.btn-danger {
    background-color: #f8d7da;
    border-color: #b00020;
}

.btn-success {
    background-color: #d4edda;
    border-color: #1b5e20;
}

.error {
    color: #b00020;
}

.success {
    color: #1b5e20;
}

.nudge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.8rem;
    color: #7a4a00;
    background-color: #fff3cd;
    border-radius: 3px;
}

#save-status {
    margin-left: 0.75rem;
    font-size: 0.9rem;
    color: #555;
}
