@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* =========================================
   ParkControl – Design-System
   Mobile-first · basiert auf KulturInventar
   ========================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg:           #f0f0f0;
    --color-surface:      #ffffff;
    --color-border:       #1b1b1b;
    --color-text:         #1b1b1b;
    --color-muted:        #777777;
    --color-divider:      #bbbbbb;
    --color-btn-save:     #a9ffac;
    --color-btn-neutral:  #e2e2e2;
    --color-error-bg:     #fff5f5;
    --color-error:        #c0392b;
    --color-error-border: #fca5a5;
    --color-success-bg:   #f0fff0;
    --color-success:      #1a7f37;
    --color-warning-bg:   #fffbeb;
    --color-warning:      #92400e;

    --border:      2px solid #1b1b1b;
    --spacing:     1rem;
    --spacing-sm:  0.5rem;
    --spacing-lg:  1.5rem;
    --radius:      8px;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.125rem;
    line-height: 1.55;
    background-color: var(--color-bg);
    color: var(--color-text);
    padding: var(--spacing);
    max-width: 640px;
    margin: 0 auto;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   Screens (SPA-Steuerung via JS)
   ========================================= */

.screen {
    display: none;
    flex-direction: column;
    gap: var(--spacing);
    min-height: calc(100dvh - 2rem);
}

.screen.active {
    display: flex;
}

/* =========================================
   Header
   ========================================= */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--spacing);
    border-bottom: var(--border);
    margin-bottom: var(--spacing-sm);
}

header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.btn-logout {
    font-size: 0.85rem;
    color: var(--color-text);
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border: var(--border);
    border-radius: 99px;
    cursor: pointer;
    background: none;
    width: auto;
}

/* =========================================
   Buttons
   ========================================= */

button, .btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text);
    background-color: var(--color-surface);
    border: var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.1s ease;
}

button:active, .btn:active {
    background-color: #e0e0e0;
}

.btn-save {
    background-color: var(--color-btn-save);
}

.btn-neutral {
    background-color: var(--color-btn-neutral);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================
   Eingabefelder
   ========================================= */

input[type="text"] {
    display: block;
    width: 100%;
    padding: 0.64rem 0.9rem;
    font-family: inherit;
    font-size: 1.125rem;
    border: var(--border);
    border-radius: var(--radius);
    background-color: var(--color-surface);
    color: var(--color-text);
    -webkit-appearance: none;
    appearance: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(27,27,27,0.15);
}

input[type="text"]::placeholder {
    text-transform: none;
    letter-spacing: normal;
    color: var(--color-muted);
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--color-muted);
}

/* =========================================
   Meldungen
   ========================================= */

.message {
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
    text-align: center;
    display: none;
}

.message.visible { display: block; }

.message-error {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border: 2px solid var(--color-error-border);
}

.message-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border: 2px solid #fcd34d;
}

/* =========================================
   Login – PIN-Pad
   ========================================= */

.login-wrap {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing);
    padding-top: 6vh;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--color-muted);
    text-align: center;
    margin-top: -0.5rem;
}

.pin-display {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    font-size: 2.5rem;
    color: #222;
    margin: 1rem 0;
    letter-spacing: 0.1em;
}

.pin-display .pin-dot {
    text-align: center;
    line-height: 1;
    min-width: 1.5rem;
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    width: 100%;
}

.pin-key {
    aspect-ratio: 1.1 / 1;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.875rem;
    color: #000;
    background-color: #f2f2f2;
    border: 1px solid #979797;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.1s;
    width: 100%;
    height: auto;
}

.pin-key:active { background-color: #e0e0e0; }

.pin-key-delete img,
.pin-key-enter img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* =========================================
   Formular – Foto-Bereich
   ========================================= */

.foto-bereich {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #d5d5d5;
    border: var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.foto-bereich img.vorschau {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-bereich .foto-label {
    font-size: 1.125rem;
    color: var(--color-text);
    text-align: center;
    z-index: 1;
}

.foto-bereich .foto-icon {
    width: 40px;
    height: 40px;
    z-index: 1;
}

.foto-bereich.hat-foto .foto-label,
.foto-bereich.hat-foto .foto-icon {
    display: none;
}

/* =========================================
   Bestätigung
   ========================================= */

.bestaetigung-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    padding-top: 4vh;
    text-align: center;
}

.bestaetigung-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.bestaetigung-titel {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.bestaetigung-detail {
    font-size: 1rem;
    color: var(--color-muted);
}

.bestaetigung-kz {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    border: var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1.5rem;
    background: var(--color-surface);
}

.btn-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: auto;
}
