/* SWATER Tư vấn kỹ thuật — gate, chat, topup modal */

.hidden { display: none !important; }

body.expert-page { background: #f6fafc; min-height: 100vh; display: flex; flex-direction: column; }
body.expert-page .site-footer { margin-top: auto; padding: 20px 0; background: #0f1f30; color: #cfdde8; text-align: center; }
body.expert-page .site-footer a { color: #5dd5ff; }

/* User box in header */
.user-box { display: flex; align-items: center; gap: 14px; }
.user-box .user-name { font-weight: 600; color: var(--ink); }
.user-box .user-balance { background: linear-gradient(135deg, #0a6fb8, #5dd5ff); color: #fff; padding: 4px 12px; border-radius: 12px; font-size: .85rem; font-weight: 600; }
.btn-icon { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; color: var(--ink-mute); }
.btn-icon:hover { background: #f3f4f6; color: var(--ink); }
.btn-sm { padding: 4px 12px; font-size: .85rem; }

/* ── Auth gate ── */
.auth-gate { padding: 60px 0; flex: 1; }
.auth-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: start; }
@media (max-width: 900px) { .auth-grid { grid-template-columns: 1fr; gap: 40px; } }

.auth-pitch h1 { font-size: 2rem; line-height: 1.25; margin: 14px 0 18px; }
.auth-pitch h1 strong { color: var(--brand); }
.pitch-list { list-style: none; padding: 0; margin: 0 0 24px; }
.pitch-list li { padding: 8px 0; color: var(--ink); }
.pricing-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 2px 18px rgba(10,30,60,0.06); }
.pricing-card h3 { margin: 0 0 12px; color: var(--brand-deep); }
.price-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.price-row:last-of-type { border-bottom: none; }
.price-row strong { color: var(--brand); }
.price-note { font-size: .85rem; color: var(--ink-mute); margin-top: 10px; }

/* ── Auth forms ── */
.auth-forms { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: 0 4px 24px rgba(10,30,60,0.08); }
.tab-switch { display: flex; gap: 8px; border-bottom: 2px solid var(--line); margin-bottom: 22px; }
.tab-btn { background: none; border: none; padding: 10px 18px; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--ink-mute); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form h2 { margin: 0 0 18px; }
.auth-form h2 small { font-size: .75rem; color: #16a34a; font-weight: 500; display: block; margin-top: 4px; }
.auth-form label { display: block; margin-bottom: 14px; font-size: .9rem; color: var(--ink); }
.auth-form input { display: block; width: 100%; padding: 10px 14px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; box-sizing: border-box; font-family: inherit; }
.auth-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,111,184,0.15); }
.btn-block { width: 100%; }
.form-error { color: #dc2626; font-size: .9rem; margin-top: 10px; min-height: 18px; }

/* Google OAuth button */
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px 18px; background: #fff; color: #1f2937; border: 1px solid #d1d5db; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: box-shadow .15s, border-color .15s; }
.btn-google:hover { border-color: #9ca3af; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.btn-google svg { flex-shrink: 0; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--ink-mute); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── Chat section ── */
.expert-chat-section { padding: 30px 0 60px; flex: 1; }
.chat-header-block { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.chat-avatar-big { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #0a6fb8, #5dd5ff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; }
.chat-header-block h2 { margin: 0; font-size: 1.3rem; }
.chat-header-block .muted { margin: 4px 0 0; color: var(--ink-mute); font-size: .9rem; }

.chat-window { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; min-height: 380px; max-height: 60vh; overflow-y: auto; margin-bottom: 14px; }
.chat-window .msg { max-width: 88%; margin-bottom: 14px; padding: 12px 16px; border-radius: 14px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.chat-window .msg-user { background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-window .msg-bot { background: #f0f9ff; color: var(--ink); border-bottom-left-radius: 4px; }
.chat-window .msg-bot strong { color: var(--brand-deep); }
.chat-window .msg-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.chat-window .typing { color: var(--ink-mute); font-style: italic; }

.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input-row textarea { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; font-family: inherit; resize: vertical; min-height: 50px; }
.chat-input-row textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,111,184,0.15); }
.chat-input-row button { padding: 12px 24px; }

.chat-meta { display: flex; gap: 24px; align-items: center; font-size: .85rem; color: var(--ink-mute); margin-top: 10px; padding: 0 4px; flex-wrap: wrap; }
.chat-meta strong { color: var(--brand); }
.chat-meta button { margin-left: auto; }

/* Attachment chips */
.attachments-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; min-height: 0; }
.attachments-bar:empty { display: none; }
.attach-chip { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 16px; padding: 5px 12px; font-size: .85rem; display: flex; align-items: center; gap: 8px; color: var(--brand-deep); }
.attach-chip .chip-size { color: var(--ink-mute); font-size: .75rem; }
.attach-chip .chip-x { background: none; border: none; cursor: pointer; color: var(--ink-mute); font-weight: 700; padding: 0 0 0 4px; font-size: 1rem; line-height: 1; }
.attach-chip .chip-x:hover { color: #dc2626; }
.attach-btn { background: #f0f9ff; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; cursor: pointer; font-size: 1.4rem; display: flex; align-items: center; min-height: 50px; color: var(--brand-deep); }
.attach-btn:hover { background: #dbeafe; }

/* Confirm card (Mr EAC xin xác nhận chi phí) */
.confirm-card { display: flex; gap: 14px; background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fcd34d; border-radius: 14px; padding: 16px; margin-top: 12px; box-shadow: 0 2px 12px rgba(180,140,30,0.1); }
.confirm-eac-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #0a6fb8, #5dd5ff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; flex-shrink: 0; }
.confirm-content { flex: 1; }
.confirm-content p { margin: 0 0 12px; line-height: 1.55; color: #78350f; }
.confirm-content p strong { color: #b45309; }
.confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm-actions .btn { padding: 8px 16px; font-size: .9rem; }

/* Bot reply with attached artifacts (Phase C2) */
.bot-artifacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.artifact-link { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; text-decoration: none; color: var(--brand-deep); font-size: .9rem; }
.artifact-link:hover { background: #f0f9ff; border-color: var(--brand); }
.artifact-link .artifact-icon { font-size: 1.2rem; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; background: rgba(15,31,48,0.7); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-card { background: #fff; border-radius: 16px; padding: 30px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--ink-mute); }
.modal-card h2 { margin: 0 0 8px; }

.topup-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.amt-btn { background: #f6fafc; border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; font-weight: 600; color: var(--ink); }
.amt-btn:hover, .amt-btn.selected { background: var(--brand); color: #fff; border-color: var(--brand); }
.amt-btn small { display: block; font-weight: 400; font-size: .8rem; margin-top: 4px; opacity: .8; }
.custom-amount { display: block; margin: 14px 0; font-size: .9rem; color: var(--ink-mute); }
.custom-amount input { display: block; width: 100%; padding: 10px 14px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; box-sizing: border-box; }

.topup-result { margin-top: 22px; }
.topup-result h3 { margin: 0 0 14px; text-align: center; }
.qr-img { display: block; margin: 0 auto 18px; max-width: 280px; width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.qr-info { background: #f0f9ff; border-radius: 10px; padding: 14px; }
.qr-info > div { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; }
.qr-info strong { color: var(--brand-deep); font-family: monospace; }
.qr-note { font-size: .85rem; color: var(--ink-mute); margin-top: 12px; line-height: 1.5; }
