/* ==========================================================================
   committee-checkin.css — Member Portal Meeting Check-In Kiosk (Phase 3)
   Token-pure, zero raw hex/colors, 44px min touch targets, 16px inputs.
   ========================================================================== */

.cc-kiosk {
    position: fixed;
    inset: 0;
    background: var(--oecta-primary);
    color: var(--oecta-on-primary);
    display: flex;
    flex-direction: column;
    font-family: var(--oecta-font-body);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10000;
}

.cc-bar {
    display: flex;
    align-items: center;
    gap: var(--oecta-space-md);
    padding: var(--oecta-space-md) var(--oecta-space-lg);
    background: color-mix(in srgb, var(--oecta-surface-lowest) 6%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--oecta-surface-lowest) 10%, transparent);
}

.cc-bar-titles {
    flex: 1;
    min-width: 0;
}

.cc-bar-title {
    font-family: var(--oecta-font-display);
    font-weight: var(--oecta-weight-extrabold);
    font-size: var(--oecta-text-md);
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--oecta-on-primary);
}

.cc-bar-sub {
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-semibold);
    font-size: var(--oecta-text-xs);
    line-height: 1.2;
    color: var(--oecta-accent);
    margin-top: 2px;
}

.cc-exit {
    flex: 0 0 auto;
    background: color-mix(in srgb, var(--oecta-surface-lowest) 14%, transparent);
    color: var(--oecta-on-primary);
    border: none;
    padding: var(--oecta-space-sm) var(--oecta-space-md);
    border-radius: var(--oecta-radius-md);
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-bold);
    font-size: var(--oecta-text-sm);
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.cc-exit:hover {
    background: color-mix(in srgb, var(--oecta-surface-lowest) 24%, transparent);
}

.cc-exit:focus-visible {
    outline: 2px solid var(--oecta-accent);
    outline-offset: 2px;
}

.cc-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--oecta-space-lg);
    min-height: 0;
}

.cc-frame {
    position: relative;
    width: 100%;
    max-width: 460px;
    aspect-ratio: 1 / 1;
    border-radius: var(--oecta-radius-xl);
    overflow: hidden;
    background: var(--oecta-primary-hover);
    box-shadow: 0 20px 60px color-mix(in srgb, var(--oecta-primary) 50%, black);
}

/* html5-qrcode sets inline position:relative on this container, sizing must be absolute fill */
#cc-qr-reader {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Maintain stream aspect ratio to avoid iOS anamorphic squeezing defect */
#cc-qr-reader video {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: fill !important;
}

#cc-qr-reader.cc-portrait-stream video {
    width: 100% !important;
    height: auto !important;
}

/* Target brackets */
.cc-target {
    position: absolute;
    inset: 12%;
    pointer-events: none;
}

.cc-target i {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 4px solid color-mix(in srgb, var(--oecta-accent) 90%, transparent);
}

.cc-target i:nth-child(1) {
    top: 0;
    left: 0;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: var(--oecta-radius-md);
}

.cc-target i:nth-child(2) {
    top: 0;
    right: 0;
    border-left: 0;
    border-bottom: 0;
    border-top-right-radius: var(--oecta-radius-md);
}

.cc-target i:nth-child(3) {
    bottom: 0;
    left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom-left-radius: var(--oecta-radius-md);
}

.cc-target i:nth-child(4) {
    bottom: 0;
    right: 0;
    border-left: 0;
    border-top: 0;
    border-bottom-right-radius: var(--oecta-radius-md);
}

.cc-frame.cc-live .cc-target {
    animation: cc-pulse 1.8s ease-in-out infinite;
}

@keyframes cc-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.cc-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--oecta-space-md);
    text-align: center;
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-semibold);
    font-size: var(--oecta-text-sm);
    line-height: 1.3;
    color: var(--oecta-on-primary);
    text-shadow: 0 1px 4px color-mix(in srgb, var(--oecta-primary) 70%, black);
    padding: 0 var(--oecta-space-lg);
}

.cc-tools {
    display: flex;
    gap: var(--oecta-space-md);
    padding: 0 var(--oecta-space-lg) var(--oecta-space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.cc-tool {
    background: color-mix(in srgb, var(--oecta-surface-lowest) 12%, transparent);
    color: var(--oecta-on-primary);
    border: none;
    padding: var(--oecta-space-md) var(--oecta-space-lg);
    border-radius: var(--oecta-radius-lg);
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-bold);
    font-size: var(--oecta-text-sm);
    min-height: 44px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--oecta-space-xs);
    transition: background 0.15s ease;
}

.cc-tool:hover {
    background: color-mix(in srgb, var(--oecta-surface-lowest) 20%, transparent);
}

.cc-tool:focus-visible {
    outline: 2px solid var(--oecta-accent);
    outline-offset: 2px;
}

/* Overlays (result / not-found / window refusal / camera-error / search) */
.cc-overlay {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--oecta-primary) 85%, transparent);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--oecta-space-xl);
    z-index: 10005;
}

.cc-overlay[hidden] {
    display: none;
}

.cc-card {
    width: 100%;
    max-width: 440px;
    background: var(--oecta-surface-lowest);
    color: var(--oecta-on-surface);
    border-radius: var(--oecta-radius-xl);
    padding: var(--oecta-space-2xl) var(--oecta-space-xl);
    text-align: center;
    box-shadow: 0 24px 70px color-mix(in srgb, var(--oecta-primary) 45%, black);
    animation: cc-pop 0.18s ease-out;
}

@keyframes cc-pop {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.cc-card--search {
    text-align: left;
    padding: var(--oecta-space-xl);
}

.cc-pill {
    display: inline-block;
    padding: var(--oecta-space-xs) var(--oecta-space-lg);
    border-radius: var(--oecta-radius-full);
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-extrabold);
    font-size: var(--oecta-text-xs);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--oecta-space-md);
}

.cc-pill--ok {
    background: var(--oecta-success-soft);
    color: var(--oecta-success-text);
}

.cc-pill--dup {
    background: var(--oecta-warning-soft);
    color: var(--oecta-warning);
}

.cc-pill--bad {
    background: var(--oecta-error-soft);
    color: var(--oecta-error-text);
}

.cc-pill--window {
    background: var(--oecta-warning-soft);
    color: var(--oecta-warning);
}

.cc-res-name {
    font-family: var(--oecta-font-display);
    font-weight: var(--oecta-weight-extrabold);
    font-size: var(--oecta-text-xl);
    line-height: 1.2;
    color: var(--oecta-primary-container);
    letter-spacing: -0.01em;
}

.cc-res-meta {
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-semibold);
    font-size: var(--oecta-text-base);
    line-height: 1.5;
    color: var(--oecta-text-muted);
    margin-top: var(--oecta-space-sm);
}

.cc-next {
    margin-top: var(--oecta-space-xl);
    width: 100%;
    padding: var(--oecta-space-md) var(--oecta-space-lg);
    min-height: 44px;
    border: none;
    border-radius: var(--oecta-radius-lg);
    cursor: pointer;
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-extrabold);
    font-size: var(--oecta-text-md);
    line-height: 1;
    color: var(--oecta-on-primary);
    background: linear-gradient(135deg, var(--oecta-accent), var(--oecta-accent-hover));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--oecta-accent) 30%, transparent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cc-next:hover {
    transform: translateY(-1px);
}

.cc-next:focus-visible {
    outline: 2px solid var(--oecta-primary-container);
    outline-offset: 2px;
}

.cc-next--ghost {
    background: var(--oecta-surface-low);
    color: var(--oecta-primary-container);
    box-shadow: none;
}

.cc-next--ghost:hover {
    background: var(--oecta-surface-high);
}

/* Manual search */
#cc-search-input {
    width: 100%;
    padding: var(--oecta-space-md) var(--oecta-space-lg);
    border: 1.5px solid var(--oecta-border);
    border-radius: var(--oecta-radius-lg);
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-medium);
    font-size: 16px; /* 16px prevents iOS Safari auto-zoom on input focus */
    line-height: 1.2;
    background: var(--oecta-surface-lowest);
    color: var(--oecta-on-surface);
    min-height: 44px;
    box-sizing: border-box;
}

#cc-search-input:focus {
    outline: none;
    border-color: var(--oecta-primary-container);
    background: var(--oecta-surface-lowest);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--oecta-primary-container) 15%, transparent);
}

.cc-search-results {
    margin-top: var(--oecta-space-md);
    max-height: 46vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-xs);
}

.cc-sr-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    width: 100%;
    background: var(--oecta-surface-low);
    border: none;
    border-radius: var(--oecta-radius-md);
    padding: var(--oecta-space-md) var(--oecta-space-md);
    min-height: 44px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cc-sr-row:hover {
    background: var(--oecta-surface-high);
}

.cc-sr-row:focus-visible {
    outline: 2px solid var(--oecta-primary-container);
    outline-offset: 1px;
}

.cc-sr-row.is-done {
    opacity: 0.6;
}

.cc-sr-name {
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-bold);
    font-size: var(--oecta-text-base);
    line-height: 1.2;
    color: var(--oecta-primary-container);
}

.cc-sr-meta {
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-medium);
    font-size: var(--oecta-text-xs);
    line-height: 1.2;
    color: var(--oecta-text-muted);
}

.cc-sr-empty {
    text-align: center;
    color: var(--oecta-text-muted);
    padding: var(--oecta-space-xl);
    font-family: var(--oecta-font-body);
    font-weight: var(--oecta-weight-medium);
    font-size: var(--oecta-text-base);
}

@media (max-width: 768px) {
    .cc-frame {
        max-width: 92vw;
    }
    .cc-res-name {
        font-size: var(--oecta-text-lg);
    }
}
