/* ═══════════════════════════════════════════════════════
   iBizi Check-in Online — Design System
   Premium, mobile-first, glassmorphism + gradients
   ═══════════════════════════════════════════════════════ */

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --success: #10b981;
    --success-light: #34d399;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-base: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-input: rgba(15, 23, 42, 0.6);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(148, 163, 184, 0.15);
    --border-focus: rgba(79, 70, 229, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ═══════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(79, 70, 229, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
}

#app {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   SCREENS
   ═══════════════════════════════════════════════════════ */

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: slideUp 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ═══════════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════════ */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-container p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════
   ERROR
   ═══════════════════════════════════════════════════════ */

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    gap: 16px;
}

.error-icon {
    font-size: 4rem;
}

.error-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.error-container p {
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════ */

.checkin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.hotel-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hotel-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
}

.hotel-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.hotel-city {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.reservation-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.badge-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.badge-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-light);
    background: var(--primary-glow);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════
   STEPPER
   ═══════════════════════════════════════════════════════ */

.stepper {
    margin-bottom: 24px;
}

.stepper-track {
    height: 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.stepper-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.stepper-labels {
    display: flex;
    justify-content: space-between;
}

.stepper-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition);
}

.stepper-label.active {
    color: var(--primary-light);
}

.stepper-label.completed {
    color: var(--success-light);
}

/* ═══════════════════════════════════════════════════════
   STEP CONTENT
   ═══════════════════════════════════════════════════════ */

.step-content {
    padding-bottom: 40px;
}

.step-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.step-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════
   INFO CARD
   ═══════════════════════════════════════════════════════ */

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(12px);
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   ROOMS LIST (Step 1)
   ═══════════════════════════════════════════════════════ */

.rooms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.room-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    backdrop-filter: blur(8px);
}

.room-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.room-details {
    flex: 1;
}

.room-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.room-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.room-guests-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.room-guests-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.room-guests-badge.complete {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-light);
}

/* ═══════════════════════════════════════════════════════
   NOTICE BOX
   ═══════════════════════════════════════════════════════ */

.checkin-notice {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.notice-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.checkin-notice strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.checkin-notice p {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   ROOM TABS (Step 2)
   ═══════════════════════════════════════════════════════ */

.rooms-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

.rooms-tabs::-webkit-scrollbar {
    display: none;
}

.room-tab {
    flex-shrink: 0;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-tab:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.room-tab.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary-light);
}

.room-tab .tab-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.tab-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.tab-badge.done {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-light);
}

/* ═══════════════════════════════════════════════════════
   GUESTS LIST
   ═══════════════════════════════════════════════════════ */

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

.guest-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(8px);
    transition: border-color var(--transition);
}

.guest-card:hover {
    border-color: rgba(148, 163, 184, 0.3);
}

.guest-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

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

.guest-info-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-info-doc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.guest-actions {
    display: flex;
    gap: 6px;
}

.guest-actions button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.guest-actions button:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: var(--primary-glow);
}

.guest-actions button.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ═══════════════════════════════════════════════════════
   GUEST FORM
   ═══════════════════════════════════════════════════════ */

.guest-form-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.form-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-light);
}

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

.form-row:has(> :nth-child(3)) {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row:has(> :nth-child(3)) {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group input,
.form-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: all var(--transition);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.form-group select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.form-group input.invalid,
.form-group select.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--success-light), var(--success));
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 16px;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    width: 100%;
}

.btn-arrow {
    font-size: 1.1em;
    transition: transform var(--transition);
}

.btn:hover .btn-arrow {
    transform: translateX(3px);
}

.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ═══════════════════════════════════════════════════════
   STEP NAVIGATION
   ═══════════════════════════════════════════════════════ */

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════
   CONFIRMATION (Step 3)
   ═══════════════════════════════════════════════════════ */

.confirmation-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.confirmation-room {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    backdrop-filter: blur(8px);
}

.confirmation-room-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirmation-guest {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.confirmation-guest:last-child {
    border-bottom: none;
}

.confirmation-guest .check {
    color: var(--success-light);
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════
   PRIVACY NOTICE
   ═══════════════════════════════════════════════════════ */

.privacy-notice {
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--primary);
    margin-top: 2px;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   SUCCESS SCREEN
   ═══════════════════════════════════════════════════════ */

.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.success-animation {
    margin-bottom: 24px;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    font-weight: 700;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

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

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.success-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
}

.success-details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 360px;
}

.success-details p {
    padding: 6px 0;
    font-size: 0.9rem;
}

.success-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 0.88rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    animation: toastIn 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }

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

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

@media (max-width: 600px) {
    .toast-container {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }
    .toast {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    #app {
        padding: 12px;
    }

    .checkin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .reservation-badge {
        align-items: flex-start;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .step-title {
        font-size: 1.15rem;
    }
}
