/* ═══════════════════════════════════════════════════════
   CHECK-IN MULTI-GUEST — CSS Premium (Dark + Accents)
   ═══════════════════════════════════════════════════════ */

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-2: #22263a;
    --border: rgba(255,255,255,0.08);
    --accent: #6c63ff;
    --accent-2: #4ecdc4;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --text: #f1f3f9;
    --text-muted: #abb2bf; /* Gris más claro para AAA Accessibility */
    --text-dim: #848b98;   /* Para etiquetas muy pequeñas pero legibles */
    --text-2: #8b91a7;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ══════════ SCREEN SYSTEM ══════════ */
.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
}

.screen {
    display: none;
    flex-direction: column;
    min-height: 100dvh;
    padding: 24px 20px 40px;
    animation: slideIn 0.35s ease;
}

.screen.active {
    display: flex;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ══════════ LOADING ══════════ */
#screen-loading {
    align-items: center;
    justify-content: center;
}

.loader-wrapper {
    text-align: center;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
    color: var(--text-2);
    font-size: 15px;
}

/* ══════════ ERROR ══════════ */
#screen-error {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-wrapper {
    padding: 32px;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 24px;
}

.error-icon { background: rgba(239, 68, 68, 0.15); }

.error-wrapper h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.error-wrapper p {
    color: var(--text-2);
    line-height: 1.6;
}

/* ══════════ DASHBOARD ══════════ */
.dashboard-header {
    margin-bottom: 28px;
}

.property-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.lang-selector {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.lang-opt {
    cursor: pointer;
    transition: color 0.2s;
}

.lang-opt:hover {
    color: var(--accent);
}

.lang-opt.active {
    color: white;
    font-weight: 700;
}

.dashboard-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #6366f1 0%, #10b981 100%); /* Termina en Verde */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reservation-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.meta-label {
    font-size: 10px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.meta-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
    flex-shrink: 0;
}

/* ══════════ PROGRESS ══════════ */
.progress-section {
    margin-bottom: 24px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 12px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.progress-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-2);
}

.progress-bar {
    height: 6px;
    background: var(--surface);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* ══════════ GUEST CARDS ══════════ */
.section-title {
    font-size: 12px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 12px;
}

.guests-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guest-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.guest-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
}

.guest-card.status-completed::before { background: var(--success); }
.guest-card.status-pending::before   { background: var(--warning); }

.guest-card.status-pending {
    cursor: pointer;
    border-color: rgba(245, 158, 11, 0.2);
}

.guest-card.status-pending:hover {
    background: var(--surface-2);
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.guest-card.status-completed {
    border-color: rgba(34, 197, 94, 0.15);
}

.guest-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.status-completed .guest-avatar { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); }
.status-pending   .guest-avatar { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); }

.guest-info {
    flex: 1;
    min-width: 0;
}

.guest-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-status-label {
    font-size: 12px;
    font-weight: 500;
}

.status-completed .guest-status-label { color: var(--success); }
.status-pending   .guest-status-label { color: var(--warning); }

.guest-action {
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.status-pending .guest-action:hover { transform: scale(1.2); }
.status-completed .guest-action { opacity: 0.5; }

/* All done banner */
.all-done-banner {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: var(--radius);
}

.done-icon { font-size: 32px; flex-shrink: 0; }

.all-done-banner strong {
    display: block;
    margin: 40px auto;
}

.lang-selector {
    font-size: 13px;
    color: var(--text-muted);
}
.lang-opt {
    cursor: pointer;
    padding: 0 5px;
}
.lang-opt.active {
    color: white;
    font-weight: bold;
}
.all-done-banner p {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
}

/* ══════════ BACK BUTTON ══════════ */
.back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 24px;
    font-weight: 500;
    align-self: flex-start;
    transition: opacity 0.2s;
}

.back-btn:hover { opacity: 0.7; }

/* ══════════ METHOD SELECTION ══════════ */
.method-header {
    text-align: center;
    margin-bottom: 32px;
}

#method-avatar {
    width: 72px;
    height: 72px;
    font-size: 32px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(108,99,255,0.15);
    border: 2px solid rgba(108,99,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.method-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.method-subtitle {
    color: var(--text-2);
    font-size: 14px;
}

.method-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.method-card {
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
}

.method-card:hover {
    background: var(--surface-2);
    border-color: rgba(108,99,255,0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108,99,255,0.15);
}

.method-icon {
    font-size: 28px;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.method-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.method-desc {
    font-size: 13px;
    color: var(--text-2);
}

/* ══════════ CAMERA ══════════ */
#screen-camera {
    padding-bottom: 32px;
}

.camera-helper-text {
    text-align: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.5;
}

.camera-helper-text strong { color: var(--text); }

.video-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 20px;
}

.scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 82%;
    height: 28%;
    border: 2px dashed rgba(108, 99, 255, 0.8);
    border-radius: 8px;
    box-shadow: 0 0 0 4000px rgba(0,0,0,0.45);
    animation: framePulse 2s ease-in-out infinite;
}

@keyframes framePulse {
    0%, 100% { border-color: rgba(108,99,255,0.8); }
    50%       { border-color: rgba(78,205,196,0.9); }
}

.scan-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.5);
    padding: 4px 12px;
    border-radius: 999px;
    position: relative;
    z-index: 1;
}

.capture-btn {
    font-size: 17px;
    font-weight: 600;
    padding: 18px;
    position: relative;
}

.capture-ring {
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--radius) + 4px);
    border: 2px solid rgba(108,99,255,0.4);
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%       { opacity: 0.8; transform: scale(1.01); }
}

/* ══════════ PROCESSING ══════════ */
#screen-processing {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.processing-wrapper {
    padding: 32px;
}

.processing-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--accent);
    animation: pulseRing 1.5s ease-out infinite;
}

@keyframes pulseRing {
    0%   { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.processing-emoji {
    font-size: 44px;
    position: relative;
    z-index: 1;
}

.processing-wrapper h2 {
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: 700;
}

.processing-wrapper p {
    color: var(--text-2);
    line-height: 1.7;
    font-size: 15px;
}

.dots-loader {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 28px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40%            { transform: scale(1);   opacity: 1;   }
}

/* ══════════ CONFIRM FORM ══════════ */
.confirm-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.confirm-subtitle {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 28px;
}

.confirm-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input {
    appearance: none;
    -webkit-appearance: none;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.2);
}

.form-group input::placeholder { color: rgba(139,145,167,0.6); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ══════════ BUTTONS ══════════ */
.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent), #8b83ff);
    color: #fff;
    box-shadow: 0 4px 16px rgba(108,99,255,0.3);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108,99,255,0.4);
}

.success-btn {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: #fff;
    box-shadow: 0 4px 16px rgba(34,197,94,0.3);
    margin-top: 8px;
}

.success-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34,197,94,0.4);
}

/* ══════════ SUCCESS ══════════ */
#screen-success {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.success-wrapper {
    padding: 32px;
    width: 100%;
}

.success-checkmark {
    font-size: 72px;
    margin-bottom: 24px;
    animation: checkBounce 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes checkBounce {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

.success-wrapper h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.success-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-2);
    margin-bottom: 12px;
}

.success-message {
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.7;
}

/* ══════════ UTILS ══════════ */
.hidden { display: none !important; }

/* Date inputs on dark background */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.5;
}
