:root {
    color-scheme: light;
    --basil: #1f7a4d;
    --tomato: #c9362c;
    --cream: #fff8e8;
    --ink: #1e261f;
    --olive: #647d38;
    --lemon: #f4c542;
    --sky: #8fc5d9;
    --shadow: 0 24px 60px rgba(40, 55, 40, 0.22);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 14% 18%, rgba(244, 197, 66, 0.26), transparent 24rem),
        radial-gradient(circle at 88% 8%, rgba(143, 197, 217, 0.32), transparent 22rem),
        linear-gradient(135deg, rgba(31, 122, 77, 0.14), transparent 26%),
        var(--cream);
}

body {
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.italy-page {
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2.5rem);
    display: grid;
    place-items: center;
}

.passport-shell {
    width: min(920px, 100%);
    overflow: hidden;
    border: 2px solid rgba(31, 122, 77, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(31, 122, 77, 0.1), transparent 18%, transparent 82%, rgba(201, 54, 44, 0.1)),
        rgba(255, 252, 243, 0.94);
    box-shadow: var(--shadow);
}

.awning {
    height: 28px;
    background: repeating-linear-gradient(90deg, var(--basil) 0 72px, #fffaf0 72px 144px, var(--tomato) 144px 216px);
    border-bottom: 3px solid rgba(30, 38, 31, 0.12);
}

.hero-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1.4rem, 4vw, 3rem);
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(255, 248, 232, 0.62)),
        repeating-linear-gradient(-35deg, rgba(31, 122, 77, 0.08) 0 10px, transparent 10px 22px);
}

.logo-button {
    padding: 0;
    border: 0;
    color: inherit;
    text-align: left;
    background: transparent;
}

.logo-button:hover h1,
.logo-button:focus-visible h1 {
    color: var(--tomato);
}

.logo-button:focus-visible {
    outline: 3px solid rgba(244, 197, 66, 0.75);
    outline-offset: 8px;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--tomato);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1;
}

h1 {
    font-size: clamp(3.3rem, 9vw, 6.6rem);
    font-weight: 900;
    color: var(--basil);
}

h1:focus {
    outline: none;
}

h2 {
    font-size: clamp(1.6rem, 5vw, 3rem);
    color: var(--ink);
}

.stamp {
    display: grid;
    place-items: center;
    width: clamp(5.3rem, 16vw, 8rem);
    aspect-ratio: 1;
    border: 4px double var(--tomato);
    border-radius: 50%;
    color: var(--tomato);
    font-weight: 900;
    transform: rotate(9deg);
    background: rgba(255, 255, 255, 0.72);
}

.traveler-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1rem, 3vw, 1.5rem);
    padding: clamp(1.25rem, 4vw, 3rem);
}

.traveler-button {
    min-height: 15rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 0;
    border-radius: 8px;
    color: white;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.65rem;
    box-shadow: 0 18px 34px rgba(31, 122, 77, 0.2);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.traveler-button:first-child {
    background:
        linear-gradient(145deg, rgba(31, 122, 77, 0.94), rgba(26, 94, 65, 0.84)),
        repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, 0.11) 18px 28px);
}

.traveler-button:last-child {
    background:
        linear-gradient(145deg, rgba(201, 54, 44, 0.94), rgba(150, 45, 45, 0.86)),
        repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, 0.12) 18px 28px);
}

.traveler-button:hover,
.traveler-button:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 26px 46px rgba(31, 122, 77, 0.26);
    outline: 3px solid rgba(244, 197, 66, 0.75);
    outline-offset: 4px;
}

.traveler-name {
    font-size: clamp(2.3rem, 8vw, 5rem);
    line-height: 0.95;
    font-weight: 900;
}

.traveler-count {
    width: fit-content;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.96);
    font-weight: 800;
}

.list-view {
    padding: clamp(1.25rem, 4vw, 3rem);
}

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.list-toolbar-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-button {
    min-width: 5.5rem;
    min-height: 3rem;
    border: 2px solid rgba(31, 122, 77, 0.22);
    border-radius: 999px;
    color: var(--basil);
    background: white;
    font-weight: 900;
}

.add-button,
.secondary-button,
.delete-section-button,
.delete-item-button,
.modal-close-button {
    min-height: 2.75rem;
    border-radius: 999px;
    font-weight: 900;
}

.add-button {
    min-width: 5rem;
    border: 2px solid var(--basil);
    color: white;
    background: var(--basil);
    box-shadow: 0 12px 26px rgba(31, 122, 77, 0.2);
}

.add-button:hover,
.add-button:focus-visible {
    background: var(--tomato);
    border-color: var(--tomato);
    outline: 3px solid rgba(244, 197, 66, 0.55);
    outline-offset: 2px;
}

.secondary-button,
.modal-close-button {
    border: 2px solid rgba(31, 122, 77, 0.22);
    color: var(--basil);
    background: white;
}

.secondary-button:hover,
.secondary-button:focus-visible,
.modal-close-button:hover,
.modal-close-button:focus-visible {
    border-color: var(--basil);
    outline: 3px solid rgba(244, 197, 66, 0.55);
    outline-offset: 2px;
}

.back-button:hover,
.back-button:focus-visible {
    border-color: var(--basil);
    outline: 3px solid rgba(244, 197, 66, 0.55);
    outline-offset: 2px;
}

.packing-list {
    display: grid;
    gap: 0.85rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.section-stack {
    display: grid;
    gap: 1.25rem;
}

.packing-section {
    display: grid;
    gap: 0.85rem;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0.15rem 0;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-heading h3 {
    margin: 0;
    color: var(--basil);
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    line-height: 1.15;
}

.section-heading span {
    flex: 0 0 auto;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    color: var(--tomato);
    background: rgba(201, 54, 44, 0.08);
    font-size: 0.9rem;
    font-weight: 900;
}

.delete-section-button,
.delete-item-button {
    width: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    color: rgba(30, 38, 31, 0.38);
    background: transparent;
}

.delete-section-button:hover,
.delete-section-button:focus-visible,
.delete-item-button:hover,
.delete-item-button:focus-visible {
    color: var(--tomato);
    background: rgba(201, 54, 44, 0.08);
    outline: 2px solid rgba(201, 54, 44, 0.2);
    outline-offset: 2px;
}

.trash-icon {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.packing-item {
    min-height: 4.75rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid rgba(31, 122, 77, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 24px rgba(30, 38, 31, 0.08);
}

.packing-item input {
    width: 1.65rem;
    aspect-ratio: 1;
    accent-color: var(--basil);
}

.packing-item label {
    min-width: 0;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 850;
    word-break: break-word;
}

.packing-item.is-packed {
    border-color: rgba(100, 125, 56, 0.28);
    background: rgba(31, 122, 77, 0.08);
}

.packing-item.is-packed label {
    color: rgba(30, 38, 31, 0.52);
    text-decoration: line-through;
    text-decoration-thickness: 0.16em;
    text-decoration-color: var(--tomato);
}

.loading-panel {
    margin: clamp(1.25rem, 4vw, 3rem);
    padding: 2rem;
    border: 2px dashed rgba(31, 122, 77, 0.35);
    border-radius: 8px;
    color: var(--olive);
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(30, 38, 31, 0.46);
}

.add-modal {
    width: min(520px, 100%);
    padding: clamp(1rem, 4vw, 1.5rem);
    border: 2px solid rgba(31, 122, 77, 0.2);
    border-radius: 8px;
    background: rgba(255, 252, 243, 0.98);
    box-shadow: var(--shadow);
}

.modal-heading,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal-heading {
    margin-bottom: 1.25rem;
}

.modal-fields {
    display: grid;
    gap: 1rem;
}

.modal-fields label {
    display: grid;
    gap: 0.4rem;
    color: var(--ink);
    font-weight: 900;
}

.modal-fields input,
.modal-fields select {
    width: 100%;
    min-height: 3rem;
    padding: 0.65rem 0.75rem;
    border: 2px solid rgba(31, 122, 77, 0.18);
    border-radius: 8px;
    color: var(--ink);
    background: white;
}

.modal-fields input:focus,
.modal-fields select:focus {
    border-color: var(--basil);
    outline: 3px solid rgba(244, 197, 66, 0.45);
}

.modal-error {
    margin: 0;
    color: var(--tomato);
    font-weight: 900;
}

.modal-actions {
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: var(--tomato);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 1rem 1rem;
    z-index: 1000;
    padding: 1rem;
    border-radius: 8px;
    color: white;
    background: var(--tomato);
    box-shadow: var(--shadow);
}

#blazor-error-ui .reload {
    color: white;
    font-weight: 800;
}

#blazor-error-ui .dismiss {
    float: right;
    cursor: pointer;
}

@media (max-width: 680px) {
    .italy-page {
        align-items: start;
        padding-top: 1rem;
    }

    .hero-band,
    .list-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .list-toolbar-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .add-button {
        width: 100%;
    }

    .traveler-grid {
        grid-template-columns: 1fr;
    }

    .traveler-button {
        min-height: 11rem;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-actions {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }

    .packing-item {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions button {
        width: 100%;
    }
}
