*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
html, body { height: 100%; overflow: hidden; background: #f0f0eb; font-family: 'Segoe UI', system-ui, sans-serif; font-size: 1rem; }
.app { max-width: 420px; margin: 0 auto; height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; }

.input-wrap {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: #f0f0eb;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 30;
  display: none;
  flex-direction: column;
}
.input-wrap.visible { display: flex; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: #f0f0eb; transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s; }
.screen.hidden { transform: translateX(100%); opacity: 0; pointer-events: none; }
.screen.slide-left { transform: translateX(-30%); opacity: 0; pointer-events: none; }

.topbar { background: #fff; border-bottom: 1px solid #e8e8e8; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; z-index: 10; }
.topbar button { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 10px; transition: background .15s; }
.topbar button:active { background: #f0f0f0; }

.site-header { flex-shrink: 0; z-index: 10; background: #fff; border-bottom: 1px solid #e8e8e8; }
.site-header-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 12px; }
.site-header-row--logos { justify-content: space-around; }
.site-header-row--logos .header-logo img { max-height: 36px; }
.site-header-row .icon-btn { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 10px; font-size: 1.25rem; color: #222; transition: background .15s; }
.site-header-row .icon-btn:active { background: #f0f0f0; }
.site-header .header-logo { display: flex; align-items: center; gap: 6px; min-height: 36px; }
.site-header .header-logo img { max-height: 32px; width: auto; object-fit: contain; display: block; }
.site-header .vodafone-logo, .site-header .horizon-logo { display: flex; align-items: center; gap: 6px; }
.site-header .vodafone-logo span { font-weight: 700; font-size: 1.1rem; color: #e60000; letter-spacing: -0.02em; }
.site-header .vodafone-symbol { width: 28px; height: 28px; background: #e60000; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem; font-weight: 800; flex-shrink: 0; }
.site-header .horizon-logo span { font-weight: 600; font-size: 1rem; color: #0d9488; letter-spacing: -0.02em; }
.site-header .horizon-symbol { width: 28px; height: 28px; background: #0d9488; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .85rem; font-weight: 800; flex-shrink: 0; }
.site-header-tagline { background: #f5f5f5; border-top: 1px solid #eee; text-align: center; padding: 6px 14px; font-size: .8rem; color: #555; }

.legal-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9999; display: none; align-items: center; justify-content: center; padding: 20px; }
.legal-modal-overlay.open { display: flex; }
.legal-modal { background: #fff; border-radius: 16px; max-width: 380px; width: 100%; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.legal-modal .legal-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #eee; }
.legal-modal .legal-modal-title { font-size: .95rem; font-weight: 700; color: #111; }
.legal-modal .legal-modal-close { background: none; border: none; cursor: pointer; padding: 6px; font-size: 1.25rem; color: #666; line-height: 1; border-radius: 8px; }
.legal-modal .legal-modal-close:hover { background: #f0f0f0; color: #111; }
.legal-modal .legal-b { padding: 16px; overflow-y: auto; font-size: .8rem; color: #444; line-height: 1.55; }
.legal-link-inline { color: #e60000; font-weight: 700; text-decoration: underline; cursor: pointer; }
.legal-link-inline:hover { color: #c00; }
.legal-note { font-size: .9rem; color: #444; }
.legal-link { background: none; border: none; color: #c0c0c0; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0 4px; }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; padding: 14px 14px 90px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.chat-scroll::-webkit-scrollbar { width: 6px; }
.chat-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 6px; }
.chat-scroll::-webkit-scrollbar-thumb:hover { background: #bbb; }

.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 20px 16px; gap: 10px; animation: fadeUp .4s ease; }
.welcome-desc { font-size: .95rem; color: #555; line-height: 1.4; max-width: 320px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 14px; max-width: 340px; justify-content: center; }
.chip { background: #fff; border: 1px solid #e0e0e0; border-radius: 20px; padding: 10px 12px; font-size: .8rem; color: #333; cursor: pointer; transition: all .18s; user-select: none; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.chip--primary { grid-column: span 2; background: #e60000; border-color: #e60000; color: #fff; font-weight: 600; padding: 12px 16px; font-size: .9rem; }
.chip--primary .chip-icon { color: #fff; }
.chip--primary:hover { background: #c00; border-color: #c00; color: #fff; }
.chip--primary:hover .chip-icon { color: #fff; }
.chip i.chip-icon { font-size: 1.1rem; color: #e60000; flex-shrink: 0; }
.chip:hover { border-color: #e60000; color: #e60000; background: #fff5f5; transform: translateY(-1px); }
.chip:hover i.chip-icon { color: #e60000; }
.chip:active { transform: scale(.96); }
.chips .chip:last-child:nth-child(odd) { grid-column: span 2; }

.msg-row { display: flex; gap: 8px; max-width: 96%; width: 100%; animation: msgIn .25s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg-row.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.bot { align-self: flex-start; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; margin-top: 2px; }
.av-bot { background: transparent; color: #fff; overflow: hidden; padding: 0; width: 44px; height: 44px; }
.av-bot img { width: 100%; height: 100%; object-fit: cover; }
.av-user { background: #222; color: #fff; }
.bubble { padding: 10px 14px; border-radius: 18px; font-size: 1rem; line-height: 1.55; word-break: break-word; }
.msg-row.user .bubble { background: #e60000; color: #fff; border-bottom-right-radius: 5px; }
.msg-row.bot .bubble { background: #fff; color: #1a1a1a; border: 1px solid #ececec; border-bottom-left-radius: 5px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.msg-row.bot .bubble strong { font-weight: 700; color: #111; }
.msg-row.bot .bubble .legal-link { margin-left: 4px; }
.ts { font-size: .68rem; color: #bbb; margin-top: 3px; padding: 0 4px; }
.msg-row.bot .ts { text-align: left; }
.msg-row.user .ts { text-align: right; }

.typing-dots { display: flex; gap: 5px; align-items: center; padding: 4px 2px; }
.typing-dots span { width: 7px; height: 7px; background: #ccc; border-radius: 50%; animation: td 1.1s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: .18s; }
.typing-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes td { 0%, 80%, 100% { transform: translateY(0); background: #ccc; } 40% { transform: translateY(-6px); background: #e60000; } }

.typing-bubble { min-height: 32px; min-width: 52px; display: inline-flex; align-items: center; }
.msg-row.bot .typing-bubble { background: #fff; color: #1a1a1a; border: 1px solid #ececec; border-bottom-left-radius: 5px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.typing-cursor::after { content: '▌'; animation: blink 0.9s step-end infinite; color: #e60000; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }

.flow-buttons-wrap { width: 100%; max-width: 96%; align-self: center; }
.flow-buttons-outer { flex: 1; display: flex; justify-content: center; min-width: 0; }
.flow-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 8px; max-width: 100%; align-items: stretch; }
.flow-btn { background: #fff; border: 1.5px solid #e60000; color: #e60000; border-radius: 16px; padding: 12px 16px; font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .18s; text-align: center; min-width: 0; word-break: break-word; line-height: 1.25; min-height: 48px; display: flex; align-items: center; justify-content: center; flex: 1; }
.flow-btn:hover { background: #e60000; color: #fff; transform: translateY(-1px); }
.flow-btn:active { transform: scale(.98); }
.flow-btn:disabled { opacity: 0.6; cursor: default; }
.flow-btn--primary { background: #e60000; color: #fff; border-color: #e60000; }
.flow-btn--primary:hover { background: #c00; color: #fff; border-color: #c00; }

.input-error-msg { display: none; margin: 4px 14px 2px; padding: 10px 14px; background: #fff0f0; border: 1px solid #f5c6cb; border-radius: 12px; font-size: .95rem; color: #c00; line-height: 1.35; }
.input-error-msg.visible { display: block; }
.input-bar { background: #fff; border-radius: 22px; margin: 6px 14px 12px; padding: 8px 10px 8px 14px; box-shadow: 0 2px 16px rgba(0,0,0,.09); transition: box-shadow .2s; }
.input-wrap.has-error .input-bar { box-shadow: 0 0 0 2px rgba(200,0,0,.25); }
.input-bar:focus-within { box-shadow: 0 2px 20px rgba(230,0,0,.18); }
.input-row { display: flex; align-items: flex-end; gap: 8px; }
.input-row input[type="text"], .input-row input[type="tel"] { flex: 1; border: none; outline: none; font-size: 1rem; color: #222; background: transparent; padding: 8px 0; }
.input-row input::placeholder { color: #222; }
.send-btn { width: 38px; height: 38px; border-radius: 50%; background: #e60000; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .18s, transform .15s; }
.send-btn:hover { background: #c00; transform: scale(1.07); }
.send-btn:disabled { background: #e0e0e0; cursor: default; transform: none; }
.send-btn i { color: #fff; font-size: .95rem; }

.scroll-fab { position: absolute; bottom: 88px; right: 16px; width: 36px; height: 36px; background: #fff; border: 1px solid #ddd; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.12); cursor: pointer; transition: opacity .2s; opacity: 0; pointer-events: none; z-index: 20; }
.scroll-fab.visible { opacity: 1; pointer-events: all; }
.scroll-fab i { color: #e60000; font-size: 1rem; }

.lead-form-wrap, .cap-form-wrap { max-width: 96%; width: 100%; align-self: center; margin-top: 6px; animation: msgIn .25s ease; }
.lead-form-wrap .form-card, .cap-form-wrap .form-card { background: #fff; border: 1px solid #ececec; border-radius: 16px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.lead-form-wrap input[type="tel"], .cap-form-wrap input[type="text"] { width: 100%; padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 12px; font-size: 1rem; margin-bottom: 12px; box-sizing: border-box; }
.lead-form-wrap input:focus, .cap-form-wrap input:focus { border-color: #e60000; outline: none; }
.lead-form-wrap .privacy-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; font-size: .85rem; color: #444; }
.lead-form-wrap .privacy-row input { margin-top: 3px; flex-shrink: 0; }
.lead-form-wrap .privacy-row a { color: #e60000; text-decoration: underline; }
.lead-form-wrap .submit-lead, .cap-form-wrap .submit-cap { width: 100%; padding: 12px; background: #e60000; color: #fff; border: none; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background .2s; }
.lead-form-wrap .submit-lead:hover, .cap-form-wrap .submit-cap:hover { background: #c00; }
.lead-form-wrap .submit-lead:disabled, .cap-form-wrap .submit-cap:disabled { background: #ccc; cursor: not-allowed; }
.lead-form-wrap .form-error, .cap-form-wrap .form-error { font-size: .8rem; color: #c00; margin-top: 4px; }
.cap-form-wrap .form-error { margin-bottom: 8px; }
.lead-form-wrap .form-success { font-size: .9rem; color: #0a0; margin-top: 8px; }

.msg-row.bot.msg-row--offer .bubble { padding: 0; background: transparent; border: none; box-shadow: none; }
.offer-card { background: #fff; border: 2px solid rgba(230, 0, 0, 0.2); border-radius: 16px; padding: 18px; margin: 0; box-shadow: 0 4px 20px rgba(0,0,0,.08); width: 100%; box-sizing: border-box; }
.offer-card .offer-title { font-size: 1.15rem; font-weight: 700; color: #e60000; margin-bottom: 6px; }
.offer-card .offer-subtitle { font-size: .9rem; color: #555; margin-bottom: 12px; line-height: 1.4; }
.offer-card .offer-price { font-size: 1.35rem; font-weight: 800; color: #111; margin-bottom: 14px; }
.offer-card .offer-bullets { list-style: none; margin: 0; padding: 0; }
.offer-card .offer-bullets li { font-size: .9rem; color: #333; margin-bottom: 8px; padding-left: 20px; position: relative; line-height: 1.4; }
.offer-card .offer-bullets li::before { content: '✓'; position: absolute; left: 0; color: #e60000; font-weight: 700; }
.offer-card .offer-note { font-size: .8rem; color: #666; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; }

#sidebarOverlay { position: absolute; inset: 0; background: rgba(0,0,0,0); z-index: 40; pointer-events: none; transition: background .3s; }
#sidebarOverlay.open { background: rgba(0,0,0,.35); pointer-events: all; }
.sidebar { position: absolute; top: 0; left: 0; bottom: 0; width: 78%; max-width: 300px; background: #fff; z-index: 50; transform: translateX(-100%); transition: transform .32s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,.12); }
.sidebar.open { transform: translateX(0); }
.sidebar-header { background: #e60000; padding: 28px 20px 20px; color: #fff; }
.sidebar-header .s-logo { font-size: 1.5rem; font-weight: 800; }
.sidebar-header .s-sub { font-size: .8rem; opacity: .8; margin-top: 2px; }
.sidebar-section { padding: 14px 0; }
.sidebar-label { font-size: .7rem; font-weight: 700; color: #bbb; text-transform: uppercase; letter-spacing: .8px; padding: 0 20px 8px; }
.sidebar-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; cursor: pointer; transition: background .15s; font-size: .9rem; color: #333; }
.sidebar-item:hover { background: #f8f8f8; }
.sidebar-item i { font-size: 1.1rem; color: #e60000; width: 22px; }
.sidebar-item.active { background: #fff3f3; font-weight: 600; color: #e60000; }
.s-badge { margin-left: auto; background: #e60000; color: #fff; border-radius: 10px; font-size: .65rem; font-weight: 700; padding: 2px 7px; }
.s-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }

#upgradeScreen { background: #fff; }
.upgrade-hero { background: linear-gradient(135deg, #e60000, #ff4444); padding: 40px 24px 32px; text-align: center; color: #fff; }
.upgrade-hero i { font-size: 2.5rem; margin-bottom: 12px; }
.upgrade-hero h2 { font-size: 1.5rem; font-weight: 800; }
.upgrade-hero p { font-size: .85rem; opacity: .85; margin-top: 6px; }
.plan-card { margin: 16px 14px; background: #fff; border: 2px solid #e0e0e0; border-radius: 18px; padding: 18px; cursor: pointer; transition: all .2s; }
.plan-card:hover, .plan-card.selected { border-color: #e60000; box-shadow: 0 4px 16px rgba(230,0,0,.15); }
.plan-card.selected { background: #fff5f5; }
.plan-name { font-weight: 700; font-size: 1rem; color: #111; }
.plan-price { font-size: 1.4rem; font-weight: 800; color: #e60000; margin-top: 4px; }
.plan-price span { font-size: .8rem; color: #999; font-weight: 400; }
.plan-features { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.plan-feat { font-size: .8rem; color: #555; display: flex; align-items: center; gap: 6px; }
.plan-feat i { color: #e60000; font-size: .75rem; }
.upgrade-cta { margin: 8px 14px 20px; background: #e60000; color: #fff; border: none; border-radius: 14px; padding: 14px; font-size: 1rem; font-weight: 700; width: calc(100% - 28px); cursor: pointer; transition: background .18s, transform .15s; }
.upgrade-cta:hover { background: #c00; transform: translateY(-1px); }

.toast-msg { position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(10px); background: #222; color: #fff; border-radius: 10px; padding: 9px 18px; font-size: .82rem; opacity: 0; pointer-events: none; transition: all .25s; white-space: nowrap; z-index: 100; }
.toast-msg.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.site-footer { width: 100%; max-width: 420px; margin: 0 auto; background: #e8e8e6; color: #666; border-top: 1px solid #ddd; padding: 10px 16px; font-size: .65rem; line-height: 1.5; position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 998; box-sizing: border-box; text-align: center; }
.site-footer a { color: #555; text-decoration: none; border-bottom: 1px solid #999; }
.site-footer .footer-inner { max-width: 400px; margin: 0 auto; }
.site-footer .footer-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; }
