body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.kiosk-header {
    background-color: #1e293b;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.status-indicator .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ef4444;
    /* offline default */
}

.status-indicator.online .dot {
    background-color: #22c55e;
}

/* Main Area */
.kiosk-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* Camera Container */
.camera-container {
    position: relative;
    width: 640px;
    height: 480px;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

#webcam,
#overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* Mirror camera */
}

#overlay-canvas {
    z-index: 10;
}

/* Oval Alignment Guide */
.alignment-guide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.oval {
    width: 280px;
    height: 380px;
    border: 3px dashed rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
    /* Darken surroundings */
}

.guide-text {
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1.1rem;
}

/* Controls */
.controls {
    text-align: center;
}

.primary-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    background-color: #475569;
    cursor: not-allowed;
    transform: none;
}

.feedback-msg {
    margin-top: 1.5rem;
    font-size: 1.25rem;
    min-height: 2rem;
    color: #94a3b8;
}

.feedback-msg.success {
    color: #4ade80;
    font-weight: 600;
}

.feedback-msg.error {
    color: #f87171;
}

/* Error Overlay */
.hidden {
    display: none !important;
}

.error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.error-overlay p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.error-overlay button {
    margin: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    background: #475569;
    color: white;
    border: none;
    border-radius: 4px;
}

/* Maintenance Menu */
#maintenance-menu {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    border: 1px solid #334155;
}

#maintenance-menu h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.warning-text {
    color: #fbbf24;
    font-weight: bold;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .kiosk-main {
        padding: 1rem;
    }

    .camera-container {
        width: 100%;
        max-width: 640px;
        height: auto;
        aspect-ratio: 4 / 3;
        margin-bottom: 1rem;
    }

    .alignment-guide .oval {
        width: 60%;
        height: 60%;
        min-width: 200px;
        min-height: 280px;
    }

    .primary-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1.25rem;
    }

    .kiosk-header {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.2rem;
    }
}