/* ═══════════════════════════════════════════════
   LexChat Web — Design System
   Accent: #65a30d (lime)  Fonts: Space Grotesk + DM Sans
   ═══════════════════════════════════════════════ */

:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-hover: #f0fdf4;
    --border: rgba(0,0,0,0.06);
    --accent: #65a30d;
    --accent-bright: #84cc16;
    --accent-hover: #4d7c0f;
    --accent-dim: rgba(101, 163, 13, 0.1);
    --accent-light: #f7fee7;
    --accent-mid: #d9f99d;
    --accent-dark: #3f6212;
    --text: #1a1c2e;
    --text-muted: #5a607a;
    --text-dim: #9098b8;
    --green: #16a34a;
    --red: #dc2626;
    --mono: "Consolas", "Fira Code", monospace;
    --sans: "DM Sans", system-ui, sans-serif;
    --heading: "Space Grotesk", system-ui, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--heading); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Mesh Background ── */
.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.page-content {
    position: relative;
    z-index: 1;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, opacity 0.15s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); text-decoration: none; }

/* ── Section layout ── */
.section-inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}
.section-label {
    font-family: var(--heading);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}
.section-title {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 36px;
    letter-spacing: -0.3px;
}
.section-sub {
    text-align: center;
    color: var(--text-muted);
    margin-top: -28px;
    margin-bottom: 36px;
    font-size: 14px;
}
.section-white {
    background: rgba(255,255,255,0.75);
    padding: 56px 0;
}
.section-grey {
    background: rgba(250,250,250,0.75);
    padding: 56px 0;
}

/* ── Laws list ── */
.laws-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 720px;
    margin: 32px auto 0;
}
.law-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.85);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(6px);
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.law-pill:hover {
    border-color: var(--accent-bright);
    box-shadow: 0 2px 12px rgba(101, 163, 13, 0.1);
}

/* ═══════════════════════════════════════
   NAV
   ═══════════════════════════════════════ */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    font-family: var(--heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-link {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
.nav-link:hover { text-decoration: none; color: var(--text); }
.nav-credits {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    padding: 4px 10px;
    background: var(--accent-dim);
    border-radius: 20px;
}
.nav-credits:hover { text-decoration: none; opacity: 0.85; }
.btn-sm { padding: 8px 20px; font-size: 13px; }

/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */
.hero {
    background: linear-gradient(135deg, rgba(247,254,231,0.75), rgba(217,249,157,0.3));
    padding: 56px 24px 48px;
}
.hero-inner {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}
.hero-badge {
    display: inline-block;
    font-family: var(--heading);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--accent-dark);
    background: var(--accent-mid);
    border-radius: 20px;
    padding: 5px 14px;
    margin-bottom: 20px;
}
.hero-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.hero-sub {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.6;
}
.hero-hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 16px;
}

/* ── Demo embedded in hero ── */
.demo-embed {
    max-width: 560px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════
   STEPS (Ako to funguje)
   ═══════════════════════════════════════ */
.steps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
}
.step { text-align: center; }
.step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-family: var(--heading);
    font-weight: 700;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.step h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}
.step p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ═══════════════════════════════════════
   TRUST CARDS (Prečo LexChat)
   ═══════════════════════════════════════ */
.trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    text-align: left;
}
.trust-card {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(4px);
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.04);
}
.trust-icon {
    color: var(--accent);
    margin-bottom: 10px;
    width: 26px;
    height: 26px;
}
.trust-icon svg {
    width: 26px;
    height: 26px;
}
.trust-icon-text {
    font-family: var(--heading);
    font-size: 22px;
    font-weight: 700;
    line-height: 26px;
    width: auto;
    height: auto;
}
.trust-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}
.trust-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ═══════════════════════════════════════
   PRICING
   ═══════════════════════════════════════ */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    align-items: start;
}
.pricing-card {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 18px;
    position: relative;
    text-align: center;
}
.pricing-featured {
    border: 2px solid var(--accent);
    background: rgba(255,255,255,0.95);
}
.pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-family: var(--heading);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 10px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}
.pricing-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.pricing-price {
    font-family: var(--heading);
    font-size: 30px;
    font-weight: 700;
}
.pricing-desc {
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 16px;
}
.pricing-features {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ═══════════════════════════════════════
   DEMO / LAW SELECTOR / CHAT
   ═══════════════════════════════════════ */
.demo-section { padding: 56px 0; }
.demo-container { display: flex; flex-direction: column; gap: 16px; }

/* ── Law Selector ── */
.law-selector-loading, .law-selector-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.law-dropdown {
    width: 100%;
    padding: 10px 16px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a607a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    margin-bottom: 12px;
    transition: border-color 0.15s;
}
.law-dropdown:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.law-dropdown:hover { border-color: var(--accent); }

/* ── Chat Interface ── */
.chat-interface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 360px;
    max-height: 500px;
    box-shadow: 0 8px 40px rgba(101,163,13,0.1);
}
.chat-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 40px;
}
.chat-law-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.chat-law-badge {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 1rem;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Chat Messages ── */
.chat-msg { display: flex; align-items: flex-start; gap: 10px; }
.chat-msg-user { flex-direction: row-reverse; }
.chat-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-bubble-user {
    background: #f5f5f5;
    border-radius: 10px 10px 2px 10px;
    font-family: var(--sans);
}
.chat-bubble-assistant {
    background: var(--accent);
    color: #fff;
    border-radius: 10px 10px 10px 2px;
    font-size: 0.85rem;
    line-height: 1.6;
    max-width: 100%;
}
.md-bold { font-weight: 700; }
.chat-citation {
    border-left: 3px solid rgba(255,255,255,0.5);
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    font-size: 0.83rem;
    line-height: 1.5;
    background: transparent;
    text-align: left;
}
.chat-bubble-wrapper { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.chat-msg-meta { font-size: 0.72rem; color: var(--text-dim); display: flex; gap: 8px; padding-left: 2px; }
.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Typing indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    min-width: 54px;
}
.chat-typing span {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* ── Chat Input ── */
.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}
.chat-input {
    flex: 1;
    background: #f5f5f5;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.9rem;
    padding: 10px 14px;
    resize: none;
    outline: none;
    line-height: 1.5;
    transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input:disabled { opacity: 0.6; }
.chat-input::placeholder { color: var(--text-dim); }
.chat-send { align-self: flex-end; padding: 10px 18px; font-size: 13px; }
.chat-hint { font-size: 0.72rem; color: var(--text-dim); text-align: center; padding: 6px 16px 10px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.chat-hint-sep { color: var(--text-dim); }

/* ── Rate limit banner ── */
.rate-limit-banner {
    margin: 0 14px 6px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--red);
}
.rate-limit-banner a { color: var(--accent); }

/* ── Chat error ── */
.chat-error {
    margin: 0 14px 6px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--red);
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.footer {
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.8);
    position: relative;
    z-index: 1;
}
.footer-inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
}

/* ═══════════════════════════════════════
   BLAZOR LOADING SCREEN
   ═══════════════════════════════════════ */
.blazor-loading {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.blazor-loading-inner { text-align: center; color: var(--text-muted); }
.blazor-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ═══════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════ */
.auth-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}
.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 28px;
    text-align: center;
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.form-hint { font-weight: 400; color: var(--text-dim); font-size: 0.8rem; }
.form-input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.95rem;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
.btn-full { width: 100%; text-align: center; margin-top: 6px; }
.auth-error {
    font-size: 0.85rem;
    color: var(--red);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
}
.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   CREDITS PAGE
   ═══════════════════════════════════════ */
.credits-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    width: 100%;
    max-width: 600px;
}
.credits-header { text-align: center; margin-bottom: 36px; }
.credits-balance {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 6px;
}
.credits-count { font-size: 3rem; font-weight: 700; color: var(--accent); }
.credits-label { font-size: 1rem; color: var(--text-muted); }
.credits-email { font-size: 0.875rem; color: var(--text-dim); }
.packages-title {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
}
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.package-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.15s;
}
.package-card:hover { border-color: var(--accent); }
.package-name { font-size: 0.95rem; font-weight: 600; }
.package-credits { font-size: 0.875rem; color: var(--text-muted); }
.btn-logout {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    font-size: 0.85rem;
}
.loading { color: var(--text-dim); text-align: center; padding: 40px; }

/* ── Success page ── */
.success-card { text-align: center; }
.success-icon {
    width: 56px;
    height: 56px;
    background: rgba(34, 197, 94, 0.15);
    border: 2px solid var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--green);
    margin: 0 auto 20px;
}
.success-card p { color: var(--text-muted); margin-bottom: 24px; }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 600px) {
    .hero-title { font-size: 26px; }
    .steps-grid { grid-template-columns: 1fr; gap: 20px; }
    .trust-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .chat-bubble { max-width: 90%; }
    .site-nav { padding: 12px 16px; }
    .nav-link { display: none; }
}
