* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --control-height: 40px;
    --brand-accent: rgb(255, 129, 98);
    --brand-blue: #2f3942;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    padding: 40px 20px;
    color: #fff;
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 40px 50px;
    background: #2f3942;
    border-radius: 18px;
}

/* When embedded in an iframe, remove outer page chrome */
html.embedded body {
    padding: 0;
    min-height: 0;
    background: transparent;
}

html.embedded .container {
    max-width: none;
    margin: 0;
    border-radius: 18px;
}

h1 {
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
    text-box-trim: trim-both;

}

h2 {
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
    text-box-trim: trim-both;

}

h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    text-box-trim: trim-both;

}

.form-step {
    margin-top: 20px;
}

.form-step.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.preregistration-form {
    margin-top: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: end;
}

/* Make side-by-side field labels same height for alignment */
.form-row label {
    min-height: 44px;
    display: flex;
    align-items: flex-end;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #fff;
}

.intro-text {
    max-width: 700px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: #e5edf2;
}

.required {
    color: #f47b6a;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="password"],
select {
    width: 100%;
    height: var(--control-height);
    padding: 0 10px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    color: #000;
}

/* License plate EU band + input */
.plate-control {
    display: flex;
    width: 100%;
    height: var(--control-height);
    border-radius: 4px;
    overflow: hidden;
    border: none;
    background: #003399; /* prevents white anti-alias corner behind euroband */
}

.euroband {
    width: 34px;
    height: 100%;
    background: #003399;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    flex: 0 0 34px;
}

.euroband-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* License plate styling */
input.license-plate-input {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    height: 100%;
    background: #fff;
    
}

.license-plate-input::placeholder {
    letter-spacing: 0.08em;
    opacity: 0.55;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
}

.plate-control .license-plate-input:focus {
    box-shadow: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1.25;
}

.checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    display: inline-grid;
    place-content: center;
    flex: 0 0 20px;
}

.checkbox-label input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(-45deg);
    margin-top: -1px;
}

.checkbox-label input[type="checkbox"]:checked {
    background: #f47b6a;
    border-color: #f47b6a;
}

.checkbox-label input[type="checkbox"]:checked::before {
    border-left-color: #fff;
    border-bottom-color: #fff;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    background: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    flex: 1;
    border-radius: 4px;
    color: #0f1720;
}

.btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.btn-primary {
    background: var(--brand-accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: rgb(239, 115, 86);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
}

.btn-link {
    background: none;
    border: none;
    text-decoration: underline;
    padding: 0;
    margin-left: 10px;
    font-size: 14px;
    flex: none;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results {
    margin-top: 30px;
}

.results.error {
    background: #dc2626;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border: 1px solid #dc2626;
    h3{
        margin-bottom: 0;
    }
}

.results.hidden {
    display: none;
}

.results h3 {
    margin-bottom: 10px;
}

.results-detail {
    margin: 0;
}

.results pre {
    background: #f5f5f5;
    padding: 15px;
    overflow-x: auto;
    margin-top: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.preflight-results {
    margin: 20px 0;
}

.preflight-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: flex-start;
}

.preflight-summary {
    padding: 20px 0;
    margin-bottom: 20px;
}

.preflight-intro {
    padding: 20px 0;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
}

.preflight-intro .info-description {
    margin: 0;
    max-width: 34ch;
}

.summary-card {
    margin-top: 5px;
    border-radius: 10px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.summary-table td {
    padding: .5rem;
}

.summary-table tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.summary-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.06);
}

.summary-table tr:first-child td:first-child {
    border-top-left-radius: 8px;
}

.summary-table tr:first-child td:last-child {
    border-top-right-radius: 8px;
}

.summary-table tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.summary-table tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.preflight-info {
    padding: 20px 0;
}

.preflight-info h3 {
    margin-bottom: 15px;
}

.info-item {
    padding: 0;
}

.visits-card {
    margin-top: 5px;
    border-radius: 10px;
}

.visits-summary {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.visits-summary td {
    padding: .5rem;
}

.visits-summary tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.visits-summary tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.06);
}

.visits-summary tr:first-child td:first-child {
    border-top-left-radius: 8px;
}

.visits-summary tr:first-child td:last-child {
    border-top-right-radius: 8px;
}

.visits-summary tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.visits-summary tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.info-item:last-child {
    border-bottom: none;
}

.info-description {
    font-size: 0.9em;
    margin-bottom: 15px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-row label {
        min-height: 0;
        display: block;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .container {
        padding: 24px 18px 32px;
    }

    .preflight-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
