/* =====================================================
   Hotel Onboarding Wizard
   Mobile/Tablet-first design
   ===================================================== */

:root {
    --brand: #1a1f3c;
    --brand-mid: #2d3561;
    --accent: #4f8ef7;
    --accent-light: #e8f0fe;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --surface: #ffffff;
    --surface-alt: #f7f8fc;
    --border: #e2e6f0;
    --text: #1a1f3c;
    --text-muted: #6b7280;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(26,31,60,0.10);
    --shadow-sm: 0 2px 8px rgba(26,31,60,0.07);
}

/* ── Shell ── */
.onboarding-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--surface-alt);
    font-family: 'Segoe UI', system-ui, sans-serif;
    max-width: 680px;
    margin: 0 auto;
}

/* ── Progress Header ── */
.progress-header {
    background: var(--brand);
    padding: 20px 16px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wizard-progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    transition: all 0.25s ease;
}

.progress-step.active .step-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 0 4px rgba(79,142,247,0.3);
}

.progress-step.done .step-dot {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-label {
    font-size: 9px;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.progress-step.active .step-label { color: rgba(255,255,255,0.9); }
.progress-step.done .step-label { color: rgba(255,255,255,0.7); }

.step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.15);
    margin-bottom: 14px;
    transition: background 0.25s;
}
.step-line.done { background: var(--success); }

/* ── Wizard Body ── */
.wizard-body {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

/* ── Step Card ── */
.step-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.2s ease;
}

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

.step-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.step-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
    margin: 0 0 6px;
}

.step-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 22px;
    line-height: 1.5;
}

/* ── Fields ── */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-input {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 16px;
    color: var(--text);
    background: var(--surface);
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.field-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
}

.field-input.invalid {
    border-color: var(--danger);
}

.field-error {
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
}

/* ── Address ── */
.address-search-row {
    position: relative;
    display: flex;
    align-items: center;
}

.address-search-row .field-input { flex: 1; }

.spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    position: absolute;
    right: 14px;
}

.suggestions-dropdown {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    box-shadow: var(--shadow);
    overflow: hidden;
    max-height: 240px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:active { background: var(--accent-light); }

.suggestion-main {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.suggestion-sub {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.address-confirmed {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 12px;
}

.confirmed-badge {
    font-size: 13px;
    font-weight: 700;
    color: #16a34a;
    margin-bottom: 8px;
}

.confirmed-address {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

/* ── Websites ── */
.url-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.url-row .field-input { flex: 1; }

/* ── Upload Zone ── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px;
}

.upload-zone:active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.upload-zone p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--brand);
}

.upload-hint {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    font-weight: 400 !important;
    margin-top: 4px !important;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    border: 1px solid var(--border);
}

.att-icon { font-size: 22px; }

.att-info {
    flex: 1;
    overflow: hidden;
}

.att-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.att-size {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Options ── */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.option-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    gap: 12px;
}
.option-toggle:last-of-type { border-bottom: none; }

.option-text { flex: 1; }
.option-text strong { display: block; font-size: 15px; color: var(--text); }
.option-text span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toggle-switch {
    width: 48px;
    height: 28px;
    border-radius: 14px;
    background: #d1d5db;
    position: relative;
    flex-shrink: 0;
    transition: background 0.25s;
    cursor: pointer;
}
.toggle-switch.on { background: var(--accent); }

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.25s;
}
.toggle-switch.on .toggle-thumb { transform: translateX(20px); }

.option-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 12px;
}

.stepper-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stepper-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: white;
    color: var(--accent);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.stepper-btn:active { background: var(--accent); color: white; }
.stepper-btn:disabled { opacity: 0.35; cursor: default; }

.stepper-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand);
    min-width: 36px;
    text-align: center;
}

/* ── QR Scanner ── */
.btn-scan {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: opacity 0.2s;
}
.btn-scan:active { opacity: 0.85; }

.scanner-container {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
    background: black;
}

.scanner-video {
    width: 100%;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-frame {
    width: 180px;
    height: 180px;
    border: 3px solid white;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
}

.scanner-cancel {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
}

.scan-result {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #16a34a;
}

.scan-result-icon { font-size: 16px; }

.qr-manual-section {
    margin-bottom: 16px;
}
.qr-manual-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.qr-input-row {
    display: flex;
    gap: 8px;
}
.qr-input-row .field-input { flex: 1; }
.btn-add-qr { flex-shrink: 0; min-width: 70px; }

.qr-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qr-list-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0 4px;
}

.qr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    border: 1px solid var(--border);
}

.qr-item-icon { font-size: 18px; color: var(--text-muted); }

.qr-item-value {
    flex: 1;
    font-size: 13px;
    font-family: monospace;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Review ── */
.review-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.review-section {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.review-section:last-child { border-bottom: none; }

.review-section h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.review-section p {
    margin: 0 0 3px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.review-url {
    font-size: 12px !important;
    color: var(--accent) !important;
    word-break: break-all;
}

.review-none { color: var(--text-muted) !important; font-style: italic; }

.review-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.feature-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
}

.feature-chip.on {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.feature-chip.off {
    background: var(--surface-alt);
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.6;
}

.submit-errors {
    margin-top: 16px;
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}
.submit-errors p {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--danger);
}
.submit-errors p:last-child { margin-bottom: 0; }

/* ── Footer ── */
.wizard-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    bottom: 0;
}

/* ── Buttons ── */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-next {
    min-width: 110px;
}

.btn-secondary {
    background: var(--surface);
    color: var(--brand);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s;
}
.btn-secondary:active { border-color: var(--accent); }

.btn-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 14px 8px;
}
.btn-back:active { color: var(--brand); }
.btn-back:disabled { opacity: 0.4; }

.btn-finish {
    background: #16a34a;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}
.btn-finish:active { opacity: 0.85; }
.btn-finish:disabled { opacity: 0.5; cursor: default; }

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 8px;
    text-decoration: underline;
}

.btn-icon-danger {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.btn-icon-danger:active { background: #fef2f2; }

/* ── Success Screen ── */
.success-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #16a34a;
    color: white;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 0 0 12px #dcfce7;
}

.success-screen h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand);
    margin: 0 0 8px;
}

.success-hotel {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand);
    margin: 0 0 12px;
}

.success-msg {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
    line-height: 1.6;
    max-width: 320px;
}

.success-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 32px;
}

.success-meta span {
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Animations ── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* ── Tablet & Desktop ── */
@media (min-width: 600px) {
    .wizard-body { padding: 28px 32px; }
    .step-card { padding: 32px 28px; }
    .wizard-footer { padding: 20px 32px; }
    .progress-header { padding: 20px 32px 16px; }
    .step-dot { width: 34px; height: 34px; font-size: 12px; }
    .step-label { font-size: 10px; }
}

.option-url-field {
    margin: -0.5rem 0 0.75rem 1rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(79,142,247,0.3);
}