:root {
    --umla-blue: #004B8D;
    --umla-blue-dark: #003da7;
    --umla-orange: #F15A24;
    --umla-orange-dark: #C6471C;
    --surface-light: #F5F7FB;
    --surface-card: #FFFFFF;
    --text-main: #0F172A;
}

/* Global layout – kiosk style */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #0F3C7A 0, var(--umla-blue-dark) 35%, #021322 100%);
    color: #FFFFFF;
    min-height: 100vh;
}

.container.kiosk-wrapper {
    min-height: 100vh;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
    display: flex;
    flex-direction: column;
}

/* Header with logo + title */
.kiosk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.25rem;
}

.kiosk-logo-title {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.umla-logo {
    height: 64px;
    max-width: 260px;
    object-fit: contain;
}

.app-title-block h1 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.app-title-block p {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    opacity: 0.85;
}

.kiosk-header-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main area */
.kiosk-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Cards */
.card {
    background-color: var(--surface-card);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
    color: var(--text-main);
}

.card h2,
.card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-weight: 650;
}

.card p {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 650;
}

label {
    font-size: 1rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.2rem;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.8rem 0.95rem;
    margin-bottom: 0.9rem;
    border-radius: 12px;
    border: 1px solid #CBD5E1;
    font-size: 1.05rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--umla-orange);
    box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.25);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.6rem;
    border-radius: 999px;
    border: none;
    background-color: var(--umla-orange);
    color: #FFFFFF;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.btn:hover {
    background-color: var(--umla-orange-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.btn-secondary {
    background-color: #0F172A;
    color: #E2E8F0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.55);
}

.btn-secondary:hover {
    background-color: #020617;
}

.btn-small {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    box-shadow: none;
}

/* Ghost-style header buttons */
.btn-ghost {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: none;
}

.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Current event pill */
.current-event {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(0, 75, 141, 0.12),
        rgba(241, 90, 36, 0.06)
    );
    border: 1px solid #E2E8F0;
    font-size: 0.96rem;
}

.current-event-empty {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background-color: #FEF9C3;
    color: #78350F;
    border: 1px solid #FACC15;
    font-size: 0.95rem;
}

/* Signature area */
.signature-container {
    border-radius: 16px;
    overflow: hidden;
    border: 2px dashed #94A3B8;
    background-color: #F8FAFC;
}

.signature-container--highlight {
    border-color: var(--umla-orange);
    box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.25);
}

.signature-container--error {
    border-color: #B91C1C;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.4);
}

.signature-error {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #B91C1C;
}

.signature-reminder-soft {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #0f172a;
}

.signature-reminder-strong {
    margin-top: 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.step-block {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1rem;
}

.step-badge {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background-color: #94A3B8; /* slightly darker for better visibility */
    color: #0F172A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
}

.step-badge-required {
    background-color: var(--umla-orange);
    color: #FFFFFF;
}

.step-body h3 {
    margin: 0;
    font-size: 1.1rem;
}

.step-body p {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: #0f172a;
}

.step-signature {
    margin-top: 1.5rem;
}

.required-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.55rem;
    margin-right: 0.4rem;
    border-radius: 999px;
    background-color: #B91C1C;
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-required-note {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #0f172a;
}

.lookup-status {
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .step-block {
        align-items: flex-start;
    }

    .step-body h3 {
        font-size: 1.05rem;
    }

    .signature-container {
        margin-top: 0.5rem;
    }
}

canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    background-color: #FFFFFF;
}

/* Flash messages */
.flash {
    margin-bottom: 0.9rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.flash-success {
    background-color: #ECFDF5;
    color: #166534;
    border-color: #BBF7D0;
}

.flash-error {
    background-color: #FEF2F2;
    color: #B91C1C;
    border-color: #FECACA;
}

/* Tables (admin view) */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

th,
td {
    padding: 0.55rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
}

th {
    background-color: #F1F5F9;
    font-weight: 600;
}

/* Keep old .top-nav selector harmless */
.top-nav {
    /* preserved so older templates don't break */
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .kiosk-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .kiosk-header-links {
        align-self: stretch;
        justify-content: flex-end;
    }

    .card {
        padding: 1.5rem 1.25rem;
    }

    .umla-logo {
        height: 52px;
    }
}

.logo-refresh-link { display: inline-flex; }
.logo-refresh-link img { display: block; }


/* Admin existing events chip list */
.event-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

.event-chip {
    border-radius: 999px;
    border: 1px solid #CBD5E1;
    background-color: #F8FAFC;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.event-chip:hover {
    background-color: #E2E8F0;
    border-color: #94A3B8;
    transform: translateY(-1px);
}

.event-chip-active {
    background-color: var(--umla-orange);
    border-color: var(--umla-orange-dark);
    color: #FFFFFF;
}

.divider {
    margin: 1rem 0;
    border: none;
    border-top: 1px dashed #CBD5E1;
}


/* Admin multi-event filter checkboxes */
.event-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0.4rem 0 0.75rem;
}

.event-filter-option {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}


/* Fullscreen toggle button */
.fullscreen-toggle {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background-color: rgba(15, 23, 42, 0.88);
    color: #E2E8F0;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.55);
}

.fullscreen-toggle:hover {
    background-color: #020617;
    transform: translateY(-1px);
}

.fullscreen-toggle span {
    font-size: 0.9rem;
}


/* Mobile-optimized layout for small screens */
@media (max-width: 640px) {
    body {
        background: var(--umla-blue);
    }

    .container.kiosk-wrapper {
        padding: 0.5rem;
        max-width: 100%;
    }

    .kiosk-wrapper {
        border-radius: 0;
        box-shadow: none;
        padding: 0.75rem 0.75rem 1.25rem;
        min-height: 100vh;
    }

    .kiosk-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .kiosk-logo-title {
        gap: 0.5rem;
        align-items: center;
    }

    .umla-logo {
        max-height: 40px;
    }

    .app-title-primary {
        font-size: 1.2rem;
    }

    .app-title-subtitle {
        font-size: 0.8rem;
        max-width: 18rem;
    }

    .kiosk-header-links {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .kiosk-main {
        margin-top: 0.25rem;
    }

    .card {
        padding: 0.9rem 0.9rem 1.1rem;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
    }

    .checkin-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .checkin-left,
    .checkin-right {
        width: 100%;
    }

    .checkin-right {
        order: 2;
    }

    .checkin-left {
        order: 1;
    }

    .signature-wrapper {
        margin-top: 0.5rem;
    }

    .signature-actions {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.9rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="number"],
    select {
        padding: 0.45rem 0.6rem;
        font-size: 0.9rem;
    }

    .footer-note {
        font-size: 0.75rem;
    }
}


/* === Mobile/admin tweaks v43 === */

/* Ensure event chips are readable on all backgrounds */
.event-chip {
    color: #0F172A;
}
.event-chip-active {
    color: #FFFFFF;
}

/* Prevent date inputs from overflowing their containers on small screens */
.card input[type="date"] {
    max-width: 100%;
    box-sizing: border-box;
}

/* Add breathing room between filter/export buttons on admin */
.admin-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}


/* === Date input overflow fix v44 (mobile Safari) === */
.form-row {
    flex-wrap: wrap;
}
.form-group {
    min-width: 0;
}
.card input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

/* On narrow screens, stack form rows to avoid overflow */
@media (max-width: 520px) {
    .form-row {
        flex-direction: column;
    }
}


/* === Header logo-only layout v45 === */
.kiosk-header.no-links {
    justify-content: center;
}
.kiosk-header.no-links .kiosk-logo-title {
    justify-content: center;
}


/* === Button spacing + mobile header centering v46 === */

/* Form action buttons (submit/back) spacing */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}
.form-actions .btn,
.form-actions a.btn {
    padding: 0.9rem 1.25rem;
}

/* On small screens, make action buttons full width and stacked */
@media (max-width: 520px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .form-actions .btn,
    .form-actions a.btn {
        width: 100%;
        text-align: center;
    }
}

/* Force centered logo on mobile when no header links are present */
.kiosk-header.no-links {
    justify-content: center !important;
}
.kiosk-header.no-links .kiosk-logo-title {
    width: 100%;
    justify-content: center;
}
.kiosk-header.no-links .logo-refresh-link {
    display: flex;
    justify-content: center;
    width: 100%;
}


.current-event-wrap {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.event-lock-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background-color: #DBEAFE;
    color: #1D4ED8;
    font-size: 0.78rem;
    font-weight: 600;
}

.full-width-input {
    width: 100%;
    box-sizing: border-box;
}

.monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
