@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --blue: #004b7d;
    --orange: #fa6400;
    --green: #4bd316;
    --light-blue: #e6f4ff;
    --gray: #f8f9fa;
    --border: #dee2e6;
    --text: #343a40;
    --white: #ffffff;
    --error: #dc3545;
    --secondary: #637492;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    color: var(--blue);
    background: var(--white);
}

/* ---- START SCREEN ---- */
body.start {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray);
}

.start-card {
    background: white;
    border-radius: 12px;
    padding: 48px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 4px 32px rgba(0,75,125,0.12);
    text-align: center;
}

.brand {
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.brand span { color: var(--orange); }

.start-logo {
    height: 40px;
    width: auto;
    margin-bottom: 12px;
}

.start-card h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--blue);
    margin-top: 16px;
    margin-bottom: 8px;
}

.start-card .subtitle {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ---- MAP LAYOUT ---- */
body.map-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--blue);
    color: white;
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    z-index: 10;
}

.header-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

.app-header .brand { color: white; font-size: 1rem; margin-bottom: 0; }
.app-header .brand span { color: var(--orange); }

.app-header .sep { color: rgba(255,255,255,0.3); margin: 0 4px; }

.app-header .page-title {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.app-header .session-info {
    margin-left: auto;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header .session-info strong { color: white; }

.app-header a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.8rem;
}

.app-header a:hover { color: white; }

.map-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#map {
    flex: 0 0 67%;
    height: 100%;
}

.sidebar {
    flex: 0 0 33%;
    height: 100%;
    overflow-y: auto;
    background: white;
    border-left: 2px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-head {
    background: var(--blue);
    color: white;
    padding: 16px 20px;
    flex-shrink: 0;
}

.sidebar-head h2 {
    font-size: 1rem;
    color: white;
    margin-bottom: 3px;
    font-weight: 700;
}

.sidebar-head p {
    font-size: 0.775rem;
    color: rgba(255,255,255,0.72);
    margin: 0;
}

.sidebar-body {
    padding: 18px 20px;
    flex: 1;
}

.sidebar-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--gray);
    flex-shrink: 0;
}

/* ---- FORM ELEMENTS ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid var(--border);
    border-radius: 7px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    color: var(--text);
    transition: border-color 0.2s;
    background: white;
    appearance: none;
    -webkit-appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23004b7d' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,75,125,0.08);
}

/* Checkboxen */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 6px;
}

.cb-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 2px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
    user-select: none;
}

.cb-item:hover { border-color: var(--blue); background: var(--light-blue); }
.cb-item.checked { border-color: var(--blue); background: var(--light-blue); color: var(--blue); }

.cb-item input[type="checkbox"] {
    accent-color: var(--blue);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}

/* Kaart status */
.map-status {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 0.82rem;
    margin-bottom: 18px;
    border: 2px solid var(--border);
    color: var(--secondary);
    font-weight: 500;
}

.map-status.ok {
    border-color: var(--green);
    background: #f2fee6;
    color: #2a7a00;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
}

.map-status.ok .status-dot { background: var(--green); }

/* Buttons */
.btn-primary {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--orange);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-align: center;
    letter-spacing: 0.2px;
}

.btn-primary:hover { background: #e25800; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: #bbb; cursor: not-allowed; transform: none; }

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 7px;
    margin-bottom: 16px;
    font-size: 0.83rem;
    font-weight: 500;
}

.alert-error { background: #fde8e8; color: var(--error); border: 1px solid #f5c6cb; }
.alert-info { background: var(--light-blue); color: var(--blue); border: 1px solid #b8daff; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 75, 125, 0.75);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 18px;
}

.loading-overlay.visible { display: flex; }

.spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(255,255,255,0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text { font-size: 1rem; font-weight: 600; }
.loading-sub { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

@keyframes spin { to { transform: rotate(360deg); } }

.hint-text {
    font-size: 0.75rem;
    color: var(--secondary);
    margin-top: 7px;
    margin-bottom: 0;
}
