@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg:         #05080F;
    --surface:    #0B1221;
    --surface2:   #111A2E;
    --surface3:   #162238;
    --border:     rgba(196, 162, 96, 0.18);
    --border-dim: rgba(196, 162, 96, 0.08);
    --gold:       #C4A260;
    --gold-light: #DEB96D;
    --gold-dim:   rgba(196, 162, 96, 0.12);
    --text:       #EDE6D2;
    --text-dim:   #A8B4C8;
    --muted:      #5C6B82;
    --success:    #4DB87A;
    --error:      #D95F5F;
    --blue:       #4A90D9;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100dvh; height: 100vh;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   LANDING PAGE
═══════════════════════════════════════════════════════ */

#page-landing {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, #0D1E38 0%, #05080F 70%);
    z-index: 10;
    transition: opacity 0.7s ease;
}
#page-landing.fade-out { opacity: 0; pointer-events: none; }

/* Subtle grid texture */
#page-landing::after {
    content: '';
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(196,162,96,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(196,162,96,0.03) 1px, transparent 1px);
    background-size: 64px 64px;
}

.lp-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 40px;
    border-bottom: 1px solid var(--border-dim);
    position: relative; z-index: 2;
}
.lp-logo {
    display: flex; align-items: center; gap: 12px;
}
.lp-logo-box {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--gold-light), #8B6830);
    display: flex; align-items: center; justify-content: center;
    color: var(--bg); font-size: 17px;
}
.lp-logo-name {
    font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
    color: var(--text);
}
.lp-logo-name span { color: var(--gold); }

.lp-header-links { display: flex; gap: 8px; align-items: center; }
.lp-link {
    padding: 7px 16px; border-radius: 8px;
    font-size: 12px; font-weight: 500; text-decoration: none;
    color: var(--text-dim); letter-spacing: 0.5px;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.lp-link:hover { color: var(--gold); border-color: var(--border); }
.lp-link.admin { border-color: var(--border-dim); }

.lp-main {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 40px 24px 60px;
    position: relative; z-index: 2;
}

/* glowing orb behind title */
.lp-main::before {
    content: '';
    position: absolute;
    width: 600px; height: 300px;
    background: radial-gradient(ellipse, rgba(196,162,96,0.06) 0%, transparent 70%);
    top: 40%; left: 50%; transform: translate(-50%,-50%);
    pointer-events: none;
}

.lp-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--border);
    border-radius: 20px; padding: 5px 16px;
    font-size: 10px; letter-spacing: 3px; font-weight: 600;
    color: var(--gold); text-transform: uppercase;
    margin-bottom: 28px;
    background: var(--gold-dim);
}
.lp-eyebrow i { font-size: 8px; }

.lp-title {
    font-size: clamp(38px, 6vw, 68px);
    font-weight: 300;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 18px;
    letter-spacing: -1px;
}
.lp-title strong {
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 60%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lp-sub {
    font-size: 15px; color: var(--text-dim);
    margin-bottom: 48px; line-height: 1.7;
    max-width: 380px;
}

.lp-cta {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 16px 44px;
    background: linear-gradient(135deg, var(--gold-light), #8B6830);
    color: var(--bg); border: none; border-radius: 14px;
    font-size: 15px; font-weight: 700; letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(196,162,96,0.28), 0 8px 24px rgba(0,0,0,0.4);
    transition: all 0.3s;
}
.lp-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 56px rgba(196,162,96,0.38), 0 12px 32px rgba(0,0,0,0.5);
}
.lp-cta i { font-size: 13px; transition: transform 0.2s; }
.lp-cta:hover i { transform: translateX(4px); }

.lp-footer {
    display: flex; align-items: center; justify-content: center; gap: 20px;
    padding: 18px 40px;
    border-top: 1px solid var(--border-dim);
    font-size: 11px; color: var(--muted); letter-spacing: 2px;
    text-transform: uppercase;
    position: relative; z-index: 2;
}
.lp-footer-dot {
    width: 3px; height: 3px; border-radius: 50%;
    background: var(--border);
}

/* ═══════════════════════════════════════════════════════
   LOGIN MODAL
═══════════════════════════════════════════════════════ */

.overlay {
    position: fixed; inset: 0;
    background: rgba(5, 8, 15, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; padding: 20px;
}
.overlay.hidden { display: none; }

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px; padding: 40px;
    width: 100%; max-width: 420px;
    position: relative;
    box-shadow: 0 48px 120px rgba(0,0,0,0.7), 0 0 60px rgba(196,162,96,0.06);
    animation: cardIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

.login-close {
    position: absolute; top: 16px; right: 16px;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--surface2); border: 1px solid var(--border-dim);
    color: var(--muted); cursor: pointer; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; outline: none;
}
.login-close:hover { border-color: var(--gold); color: var(--gold); }

.login-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 32px;
}
.login-icon {
    width: 50px; height: 50px; border-radius: 14px;
    background: linear-gradient(135deg, var(--gold-light), #8B6830);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--bg); flex-shrink: 0;
}
.login-header h2 { font-size: 19px; font-weight: 700; }
.login-header p  { font-size: 12px; color: var(--muted); margin-top: 2px; }

.form-field { margin-bottom: 18px; }
.form-field label {
    display: block; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-dim); margin-bottom: 8px;
}
.form-field input {
    width: 100%; padding: 13px 16px;
    background: var(--surface2);
    border: 1px solid var(--border-dim); border-radius: 12px;
    color: var(--text); font-size: 14px; outline: none;
    transition: border 0.2s, box-shadow 0.2s; font-family: inherit;
}
.form-field input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(196,162,96,0.1);
}
.form-field input::placeholder { color: var(--muted); }

.phone-row { display: flex; }
.phone-pfx {
    padding: 13px 14px;
    background: var(--gold-dim); border: 1px solid var(--border-dim);
    border-right: none; border-radius: 12px 0 0 12px;
    font-size: 14px; font-weight: 600; color: var(--gold); white-space: nowrap;
}
.phone-row input { border-radius: 0 12px 12px 0; }
.field-hint { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; }

.btn-login {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--gold-light), #8B6830);
    color: var(--bg); border: none; border-radius: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    letter-spacing: 0.5px; margin-top: 8px; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(196,162,96,0.35); }
.btn-login:disabled { opacity: 0.7; cursor: wait; transform: none; }
.login-err { color: var(--error); font-size: 12px; text-align: center; margin-top: 10px; min-height: 16px; }

/* ═══════════════════════════════════════════════════════
   CHAT APP
═══════════════════════════════════════════════════════ */

#chat-app {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    background: var(--bg);
}
#chat-app.hidden { display: none; }

/* Chat Header */
.chat-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-dim);
    flex-shrink: 0; z-index: 10;
}
.chat-logo { display: flex; align-items: center; gap: 11px; }
.chat-logo-box {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--gold-light), #8B6830);
    display: flex; align-items: center; justify-content: center;
    color: var(--bg); font-size: 16px;
}
.chat-logo-text h1 { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }
.chat-logo-text p  { font-size: 10px; color: var(--muted); letter-spacing: 0.5px; }

.chat-header-right { display: flex; align-items: center; gap: 12px; }
#user-badge {
    display: flex; align-items: center; gap: 6px;
    background: var(--gold-dim); border: 1px solid var(--border);
    border-radius: 20px; padding: 5px 12px;
    font-size: 12px; font-weight: 600; color: var(--gold);
}
.online-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success); box-shadow: 0 0 6px var(--success);
}

/* Call Banner */
#call-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 22px;
    background: linear-gradient(90deg, #0B1B30, #0F2540);
    border-bottom: 1px solid rgba(74,144,217,0.2);
    font-size: 13px; color: #7DB4E0;
    flex-shrink: 0; transition: opacity 0.5s;
}
#call-banner.success-call {
    background: linear-gradient(90deg, #091A14, #0E2A1C);
    border-bottom-color: rgba(77,184,122,0.2);
    color: #7DDBA0;
}
#call-banner.fail-call {
    background: linear-gradient(90deg, #1A0D0D, #2A1010);
    border-bottom-color: rgba(217,95,95,0.2);
    color: #E08080;
}

/* Messages Area */
#chat-messages {
    flex: 1; overflow-y: auto;
    padding: 22px 18px;
    display: flex; flex-direction: column; gap: 14px;
    scroll-behavior: smooth;
}
#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--border-dim); border-radius: 4px; }

.msg {
    display: flex; gap: 10px; max-width: 84%;
    animation: msgIn 0.25s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msg.user  { align-self: flex-end;   flex-direction: row-reverse; }
.msg.agent { align-self: flex-start; }

.msg-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid var(--border-dim);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.msg.agent .msg-avatar { background: var(--surface2); color: var(--gold); }
.msg.user  .msg-avatar { background: var(--gold); color: var(--bg); border: none; }

.msg-body { display: flex; flex-direction: column; gap: 6px; }

.msg-bubble {
    padding: 11px 15px; border-radius: 14px;
    font-size: 14px; line-height: 1.55;
}
.msg.agent .msg-bubble {
    background: var(--surface2);
    border: 1px solid var(--border-dim);
    border-top-left-radius: 4px;
    color: var(--text);
}
.msg.user .msg-bubble {
    background: linear-gradient(135deg, var(--gold-light), #8B6830);
    color: var(--bg); font-weight: 500;
    border-top-right-radius: 4px;
}
.msg.user.pending .msg-bubble {
    opacity: 0.7;
    font-style: italic;
}

/* Map hint */
.map-hint {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 11px;
    background: var(--gold-dim); border: 1px solid var(--border-dim);
    border-radius: 8px; font-size: 12px; color: var(--gold);
}

/* Nav Directions */
.nav-directions {
    background: rgba(77,184,122,0.06);
    border: 1px solid rgba(77,184,122,0.18);
    border-radius: 10px; padding: 11px 14px; font-size: 13px;
}
.nav-header {
    display: flex; align-items: center; gap: 8px;
    color: var(--success); margin-bottom: 8px;
}
.nav-dist { margin-left: auto; font-size: 12px; opacity: 0.75; display: flex; align-items: center; gap: 4px; }
.nav-steps { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.nav-steps li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-dim); line-height: 1.4; }
.step-num {
    background: rgba(77,184,122,0.15); color: var(--success);
    border-radius: 50%; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* Chat Footer */
.chat-footer {
    padding: 14px 18px 18px;
    background: var(--surface);
    border-top: 1px solid var(--border-dim);
    flex-shrink: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.input-row { display: flex; gap: 8px; align-items: center; }
#text-input {
    flex: 1; padding: 12px 18px;
    background: var(--surface2);
    border: 1px solid var(--border-dim);
    border-radius: 20px; color: var(--text); font-size: 14px;
    outline: none; transition: border 0.2s; font-family: inherit;
}
#text-input:focus { border-color: var(--gold); }
#text-input::placeholder { color: var(--muted); }

#send-btn {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--gold-light), #8B6830);
    border: none; cursor: pointer; color: var(--bg); font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
#send-btn:hover { transform: scale(1.08); }

.voice-row {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
#mic-btn {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--surface2); border: 1px solid var(--border-dim);
    color: var(--gold); font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
#mic-btn:hover { border-color: var(--gold); box-shadow: 0 0 16px rgba(196,162,96,0.2); }
#mic-btn.recording { background: var(--error); color: #fff; border-color: var(--error); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(217,95,95,0.4); } 70% { box-shadow: 0 0 0 12px rgba(217,95,95,0); } }
#mic-status { font-size: 11px; color: var(--muted); }
#live-caption {
    min-height: 0;
    max-width: 520px;
    margin: 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
    color: var(--gold);
    padding: 0 16px;
}
#live-caption:empty { display: none; }
