/* ============================================
   BER Vehicle Reservation System
   Swiss Minimalism Design System
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
    /* Colors */
    --color-white: #ffffff;
    --color-bg: #f7f8fa;
    --color-bg-alt: #eef0f4;
    --color-surface: #ffffff;
    --color-border: #e2e5ea;
    --color-border-light: #f0f1f4;
    --color-text: #111827;
    --color-text-secondary: #5f6775;
    --color-text-muted: #9ca3af;

    /* Brand accent — teal */
    --color-accent: #0d9488;
    --color-accent-hover: #0b7f74;
    --color-accent-light: #ccfbf1;
    --color-accent-bg: #f0fdfa;

    /* Status colors */
    --color-success: #059669;
    --color-success-bg: #ecfdf5;
    --color-warning: #d97706;
    --color-warning-bg: #fffbeb;
    --color-error: #dc2626;
    --color-error-bg: #fef2f2;
    --color-info: #2563eb;
    --color-info-bg: #eff6ff;

    /* Spacing (8px scale) */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 24px;
    --s7: 32px;
    --s8: 40px;
    --s9: 48px;
    --s10: 56px;
    --s11: 64px;
    --s12: 80px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.8125rem;
    /* 13px */
    --text-base: 0.9375rem;
    /* 15px */
    --text-md: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.375rem;
    /* 22px */
    --text-2xl: 1.75rem;
    /* 28px */
    --text-3xl: 2.25rem;
    /* 36px */
    --text-4xl: 2.5rem;
    /* 40px */
    --line-height: 1.6;
    --line-height-tight: 1.3;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);

    /* Motion */
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --duration-fast: 150ms;
    --duration-normal: 200ms;

    /* Layout */
    --max-width: 1200px;
    --max-width-narrow: 720px;
    --max-width-form: 640px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--line-height);
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
}

a:hover {
    color: var(--color-accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

/* --- Layout --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--s6);
}

.container--narrow {
    max-width: var(--max-width-narrow);
}

.container--form {
    max-width: var(--max-width-form);
}

/* --- Header --- */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: var(--s4) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--s6);
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: var(--s4);
}

.site-header__logo {
    height: 36px;
    width: auto;
}

.site-header__divider {
    width: 1px;
    height: 28px;
    background: var(--color-border);
}

.site-header__title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: 0.01em;
}

/* --- Hero --- */
.hero {
    padding: var(--s12) 0;
    text-align: center;
}

.hero__title {
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: var(--line-height-tight);
    letter-spacing: -0.02em;
    margin-bottom: var(--s3);
}

.hero__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--s8);
    line-height: var(--line-height);
}

/* --- Cards --- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--s7);
    transition: box-shadow var(--duration-normal) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card--flat {
    box-shadow: none;
}

.card--flat:hover {
    box-shadow: none;
}

.card__title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--s2);
}

.card__subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--s5);
}

.card__icon {
    font-size: 2rem;
    margin-bottom: var(--s4);
}

/* Vehicle cards grid */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s6);
    margin-top: var(--s7);
}

.vehicle-card {
    text-align: left;
}

.vehicle-specs {
    margin: var(--s4) 0;
}

.vehicle-specs dt {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-top: var(--s3);
}

.vehicle-specs dd {
    font-size: var(--text-base);
    color: var(--color-text);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 500;
    padding: var(--s3) var(--s6);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.btn--primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--color-white);
}

.btn--secondary {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
}

.btn--ghost {
    background: transparent;
    color: var(--color-accent);
    padding: var(--s2) var(--s3);
}

.btn--ghost:hover {
    background: var(--color-accent-bg);
}

.btn--danger {
    background: var(--color-error);
    color: var(--color-white);
    border-color: var(--color-error);
}

.btn--danger:hover {
    background: #b91c1c;
}

.btn--lg {
    padding: var(--s4) var(--s7);
    font-size: var(--text-md);
    border-radius: var(--radius-md);
}

.btn--full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Forms --- */
.form-group {
    margin-bottom: var(--s5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--s2);
    color: var(--color-text);
}

.form-label--required::after {
    content: ' *';
    color: var(--color-error);
    font-weight: 400;
}

.form-input {
    width: 100%;
    padding: var(--s3) var(--s4);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-fast) var(--ease);
    outline: none;
}

.form-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-input--error {
    border-color: var(--color-error);
}

.form-input--error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-helper {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--s1);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-error);
    margin-top: var(--s1);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Two-column form layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s4);
}

/* Checkbox / Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    margin-bottom: var(--s3);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--color-accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.form-check label {
    font-size: var(--text-sm);
    color: var(--color-text);
    cursor: pointer;
    line-height: 1.5;
}

/* --- Stepper --- */
.stepper {
    display: flex;
    justify-content: center;
    gap: var(--s2);
    margin-bottom: var(--s8);
}

.stepper__step {
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.stepper__dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    border: 2px solid transparent;
    transition: all var(--duration-normal) var(--ease);
}

.stepper__step--active .stepper__dot {
    background: var(--color-accent);
    color: var(--color-white);
}

.stepper__step--complete .stepper__dot {
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.stepper__label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    display: none;
}

.stepper__step--active .stepper__label {
    color: var(--color-text);
    font-weight: 500;
}

.stepper__connector {
    width: 40px;
    height: 2px;
    background: var(--color-border);
    align-self: center;
}

.stepper__step--complete+.stepper__connector {
    background: var(--color-accent);
}

/* --- Alerts / Status badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--s3);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge--pending {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge--confirmed {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge--denied {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.badge--canceled {
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
}

.badge--active {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.badge--complete {
    background: var(--color-accent-bg);
    color: var(--color-accent);
}

.alert {
    padding: var(--s4) var(--s5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
}

.alert--success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.alert--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.alert--error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.alert--info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

/* --- Calendar --- */
.calendar {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-white);
}

.calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--color-border);
}

.calendar__title {
    font-size: var(--text-lg);
    font-weight: 600;
}

.calendar__nav {
    display: flex;
    gap: var(--s2);
}

.calendar__nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    cursor: pointer;
    font-size: var(--text-md);
    color: var(--color-text);
    transition: background var(--duration-fast) var(--ease);
}

.calendar__nav-btn:hover {
    background: var(--color-bg);
}

.calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar__day-label {
    padding: var(--s3) var(--s2);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border-light);
}

.calendar__day {
    padding: var(--s3) var(--s2);
    text-align: center;
    font-size: var(--text-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar__day:hover {
    background: var(--color-accent-bg);
}

.calendar__day--today {
    font-weight: 600;
    color: var(--color-accent);
}

.calendar__day--available {
    color: var(--color-text);
}

.calendar__day--pending {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    cursor: default;
}

.calendar__day--confirmed,
.calendar__day--booked {
    background: var(--color-error-bg);
    color: var(--color-error);
    cursor: default;
}

.calendar__day--blocked {
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    cursor: default;
    text-decoration: line-through;
}

.calendar__day--outside {
    color: var(--color-text-muted);
    opacity: 0.3;
    cursor: default;
}

.calendar__day--selected {
    background: var(--color-accent);
    color: var(--color-white);
    border-radius: var(--radius-sm);
}

.calendar__legend {
    display: flex;
    gap: var(--s5);
    padding: var(--s3) var(--s5);
    border-top: 1px solid var(--color-border);
    justify-content: center;
}

.calendar__legend-item {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.calendar__legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* --- Photo Upload Grid --- */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s4);
}

.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--s6);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
}

.upload-zone:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-bg);
}

.upload-zone--has-file {
    border-style: solid;
    border-color: var(--color-accent);
    background: var(--color-accent-bg);
}

.upload-zone__icon {
    font-size: 1.5rem;
    color: var(--color-text-muted);
}

.upload-zone__label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.upload-zone__hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.upload-zone__preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    position: absolute;
    inset: 0;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* --- Signature Pad --- */
.signature-pad {
    width: 100%;
    height: 180px;
    display: block;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    cursor: crosshair;
    touch-action: none;
}

.signature-pad-wrapper {
    position: relative;
}

.signature-pad-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--s2);
    margin-top: var(--s2);
}

/* --- Timeline (status page) --- */
.timeline {
    position: relative;
    padding-left: var(--s7);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--color-border);
}

.timeline__item {
    position: relative;
    padding-bottom: var(--s5);
}

.timeline__dot {
    position: absolute;
    left: calc(-1 * var(--s7) + 4px);
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-bg-alt);
    border: 2px solid var(--color-border);
}

.timeline__item--active .timeline__dot {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.timeline__title {
    font-size: var(--text-sm);
    font-weight: 500;
}

.timeline__date {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* --- Section divider --- */
.divider {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: var(--s7) 0;
}

/* --- Page sections --- */
.section {
    padding: var(--s9) 0;
}

.section__title {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: var(--s2);
}

.section__subtitle {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--s7);
}

/* --- Toast notifications --- */
.toast {
    position: fixed;
    bottom: var(--s6);
    right: var(--s6);
    padding: var(--s4) var(--s6);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-white);
    background: var(--color-text);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--duration-normal) var(--ease);
}

.toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.toast--success {
    background: var(--color-success);
}

.toast--error {
    background: var(--color-error);
}

/* --- Loading / Spinner --- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

/* --- Footer --- */
.site-footer {
    padding: var(--s7) 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* --- Utilities --- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.text-accent {
    color: var(--color-accent);
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.mt-2 {
    margin-top: var(--s2);
}

.mt-4 {
    margin-top: var(--s4);
}

.mt-6 {
    margin-top: var(--s6);
}

.mt-8 {
    margin-top: var(--s8);
}

.mb-2 {
    margin-bottom: var(--s2);
}

.mb-4 {
    margin-bottom: var(--s4);
}

.mb-6 {
    margin-bottom: var(--s6);
}

.gap-4 {
    gap: var(--s4);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.hidden {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero__title {
        font-size: var(--text-2xl);
    }

    .hero__subtitle {
        font-size: var(--text-base);
    }

    .vehicle-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .stepper__label {
        display: none;
    }

    .stepper__connector {
        width: 20px;
    }

    .container {
        padding: 0 var(--s4);
    }
}

@media (min-width: 769px) {
    .stepper__label {
        display: block;
    }
}