/* ═══════════════════════════════════════════════════════════════
   GESTISURE CLIENT — DESIGN LANDING PAGE PREMIUM (LIGHT)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg-primary:     #F7F8FA;
    --bg-secondary:   #FFFFFF;
    --bg-tertiary:    #EEF1F5;
    --bg-hover:       #E8EBF0;
    --border-color:   #DDE1E7;
    --border-subtle:  #E8ECF0;

    --text-primary:   #1A2B4A;
    --text-secondary: #5A6B85;
    --text-muted:     #8C96A5;

    --accent:         #2E6FBA;
    --accent-dark:    #1E4F8A;
    --accent-light:   #4A8FD9;
    --accent-surface: rgba(46, 111, 186, 0.06);
    --accent-hover:   rgba(46, 111, 186, 0.12);

    --success:        #2D9D5C;
    --warning:        #E0962C;
    --error:          #D94343;

    --card-blue:      #EBF2FB;
    --card-blue-bdr:  #B8D4F0;
    --card-orange:    #FEF4E8;
    --card-orange-bdr:#F0D4A8;
    --card-red:       #FCEAEA;
    --card-red-bdr:   #F0B8B8;

    --radius-sm:      8px;
    --radius-md:      14px;
    --radius-lg:      20px;
    --radius-full:    9999px;

    --max-width:      960px;
    --header-height:  64px;
    --input-height:   56px;

    --shadow-sm:      0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.10);
    --shadow-hover:   0 8px 28px rgba(46,111,186,0.15);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */

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

html {
    color-scheme: light only;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-family: "Inter", "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Force light mode — bloque le dark mode Android/iOS ── */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light only;
    }
    html, body {
        background: #F7F8FA !important;
        background-color: #F7F8FA !important;
        color: #1A2B4A !important;
    }
}

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

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER — Premium
   ═══════════════════════════════════════════════════════════════ */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-secondary);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}
.app-header .logo:hover { text-decoration: none; }

.app-header .logo img {
    height: 80px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-link {
    display: none;
    padding: 8px 16px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-full);
    transition: background .15s, color .15s;
}
.header-link:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.lang-switcher:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

/* Stepper dots */
.phase-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}
.phase-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background .2s, transform .2s;
}
.phase-dot.active {
    background: var(--accent);
    transform: scale(1.3);
}
.phase-dot.done {
    background: var(--success);
}

/* Main content */
.app-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.content-centered {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

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

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    padding: 0;
}

/* ── Hero Section ── */
.hero {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: .75rem;
}

.hero-text .subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.hero-chat {
    display: flex;
    justify-content: center;
}

.hero-chat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    max-width: 340px;
    width: 100%;
}

.hero-chat-card .chat-preview {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.hero-chat-card .chat-preview .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-surface);
    border: 2px solid var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.hero-chat-card .chat-preview .bubble {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px 14px 14px 14px;
    padding: 12px 16px;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--text-primary);
}

/* ── Service Cards Grid ── */
.services-section {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 2rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    text-decoration: none;
    color: var(--text-primary);
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}
.service-card:active {
    transform: translateY(-1px);
}

.service-card.card-blue  { border-color: var(--card-blue-bdr); }
.service-card.card-blue  .service-icon { background: var(--card-blue); color: var(--accent); }
.service-card.card-orange { border-color: var(--card-orange-bdr); }
.service-card.card-orange .service-icon { background: var(--card-orange); color: var(--warning); }
.service-card.card-red   { border-color: var(--card-red-bdr); }
.service-card.card-red   .service-icon { background: var(--card-red); color: var(--error); }

.service-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.service-card .service-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.service-card .service-desc {
    font-size: .85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ── Language grid (within welcome) ── */
.lang-section {
    width: 100%;
    max-width: 520px;
    padding: 1rem 2rem 2rem;
}

.lang-section-title {
    text-align: center;
    font-size: .95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
    text-decoration: none;
}
.lang-btn:hover {
    background: var(--accent-surface);
    border-color: var(--accent);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.lang-btn:active {
    transform: scale(.97);
}
.lang-btn .flag { font-size: 1.4rem; }

/* Welcome logo + greeting (kept for compat) */
.welcome-logo {
    width: 140px;
    height: auto;
    margin-bottom: 1rem;
}

.welcome-greeting {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: .5rem;
}

.welcome-greeting .accent {
    color: var(--accent);
}

.welcome-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   FLOATING ACTION BUTTON (Contact)
   ═══════════════════════════════════════════════════════════════ */

.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(46,111,186,0.35);
    z-index: 200;
    transition: transform .2s, box-shadow .2s, background .15s;
    text-decoration: none;
}
.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(46,111,186,0.45);
    text-decoration: none;
    background: var(--accent-dark);
}
.fab:active {
    transform: scale(.95);
}
.fab svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT INTERFACE
   ═══════════════════════════════════════════════════════════════ */

.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chat-messages {
    flex: 1 1 0;           /* basis:0 → grow from 0, never exceed parent */
    min-height: 0;         /* override flex default min-height:auto */
    height: 0;             /* belt+suspenders: start at 0, flex-grow fills */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0 1.5rem;
    overscroll-behavior: contain;
}

.chat-messages .content-centered {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    max-width: 720px;
}

/* Empty state */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 3rem 1.5rem;
    text-align: center;
}

.chat-welcome img {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
}

.chat-welcome h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: .3rem;
    color: var(--accent);
}

.chat-welcome .subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Message bubbles */
.msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn .25s ease;
}

.msg.assistant {
    align-self: flex-start;
}

.msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.msg.assistant .msg-avatar {
    background: var(--accent-surface);
    border: 1px solid rgba(46, 111, 186, 0.2);
}

.msg.user .msg-avatar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.msg-content {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: .95rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* Liens cliquables dans les messages */
.msg-content a {
    text-decoration: underline;
    word-break: break-all;
}
.msg.assistant .msg-content a { color: var(--accent); }
.msg.user .msg-content a { color: #fff; }

.msg.assistant .msg-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-top-left-radius: 4px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.msg.user .msg-content {
    background: var(--accent);
    color: #fff;
    border-top-right-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce .6s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .1s; }
.typing-indicator span:nth-child(3) { animation-delay: .2s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* ═══════════════════════════════════════════════════════════════
   SUGGESTION CHIPS
   ═══════════════════════════════════════════════════════════════ */

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 1rem 0;
    max-width: 720px;
    margin: 0 auto;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
    white-space: nowrap;
    text-decoration: none;
}
.chip:hover {
    background: var(--accent-surface);
    border-color: var(--accent);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.chip:active {
    transform: scale(.97);
}
.chip .chip-icon {
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT INPUT BAR
   ═══════════════════════════════════════════════════════════════ */

.chat-input-area {
    flex-shrink: 0;
    padding: 10px 16px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
}

.chat-input-wrapper {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4px 4px 4px 16px;
    transition: border-color .2s, box-shadow .2s;
}
.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(46,111,186,0.1);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    padding: 10px 0;
    resize: none;
    min-height: 24px;
    max-height: 140px;
    outline: none;
}
.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}
.chat-send-btn:hover {
    background: var(--accent-dark);
}
.chat-send-btn:active {
    transform: scale(.92);
}
.chat-send-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   VOICE BUTTON
   ═══════════════════════════════════════════════════════════════ */

.voice-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, transform .1s, box-shadow .2s;
}
.voice-btn:hover {
    background: var(--accent-dark);
}
.voice-btn:active {
    transform: scale(.92);
}
.voice-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.voice-btn svg {
    width: 22px;
    height: 22px;
}
.voice-btn.recording {
    background: #E53935;
    animation: voice-pulse 1s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.5);
}
@keyframes voice-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.5); }
    70%  { box-shadow: 0 0 0 12px rgba(229, 57, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

/* ═══════════════════════════════════════════════════════════════
   SLOT PICKER — PRISE DE RDV
   ═══════════════════════════════════════════════════════════════ */

.date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}
.date-btn {
    padding: 10px 8px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.date-btn:hover {
    border-color: var(--accent);
    background: rgba(46, 111, 186, 0.06);
}
.date-btn.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.slot-btn {
    padding: 10px 8px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.slot-btn:hover {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.06);
}
.slot-btn.selected {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS — WIZARD STEPS
   ═══════════════════════════════════════════════════════════════ */

.form-page {
    padding: 2rem 0;
}

.form-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.form-card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.form-card h3 {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(46,111,186,0.1);
}
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* File upload dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    color: var(--text-secondary);
}
.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-surface);
}
.dropzone .dropzone-icon {
    font-size: 2rem;
    margin-bottom: .5rem;
}
.dropzone input[type="file"] {
    display: none;
}

/* Checkbox */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
}
.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: .95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
    min-height: 48px;
    touch-action: manipulation;
}
.btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-full { width: 100%; }

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════ */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 1rem;
}
.alert-info {
    background: var(--accent-surface);
    border: 1px solid rgba(46, 111, 186, 0.2);
    color: var(--accent);
}
.alert-success {
    background: rgba(45, 157, 92, 0.08);
    border: 1px solid rgba(45, 157, 92, 0.2);
    color: var(--success);
}
.alert-warning {
    background: rgba(224, 150, 44, 0.08);
    border: 1px solid rgba(224, 150, 44, 0.2);
    color: var(--warning);
}
.alert-error {
    background: rgba(217, 67, 67, 0.08);
    border: 1px solid rgba(217, 67, 67, 0.2);
    color: var(--error);
}

/* ═══════════════════════════════════════════════════════════════
   DATA LIST (key-value)
   ═══════════════════════════════════════════════════════════════ */

.data-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
}
.data-list dt {
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 500;
}
.data-list dd {
    color: var(--text-primary);
    font-size: .95rem;
}

/* ═══════════════════════════════════════════════════════════════
   EXPANDER / ACCORDION
   ═══════════════════════════════════════════════════════════════ */

.expander {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
    background: var(--bg-secondary);
}
.expander-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
}
.expander-body {
    padding: 0 16px 16px;
    font-size: .9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════════════════════════════════ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* ═══════════════════════════════════════════════════════════════
   OCR RESULT PREVIEW
   ═══════════════════════════════════════════════════════════════ */

.ocr-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}
.ocr-preview .preview-image {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.ocr-preview .preview-image img {
    width: 100%;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   TRANSMISSION SUCCESS
   ═══════════════════════════════════════════════════════════════ */

.success-container {
    text-align: center;
    padding: 3rem 1.5rem;
}
.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
.success-text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   CONVERSION PAGE — ACTION CARDS
   ═══════════════════════════════════════════════════════════════ */

.action-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 1.5rem;
}
.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.action-card:hover {
    border-color: var(--accent);
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.action-card .action-icon { font-size: 1.5rem; }
.action-card .action-label { font-weight: 600; font-size: .9rem; }
.action-card .action-desc { font-size: .8rem; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 641px) {
    .header-link { display: inline-flex; }
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem 1.5rem;
        gap: 1.5rem;
        text-align: center;
    }
    .hero-text h1 { font-size: 1.7rem; }
    .hero-chat-card { max-width: 100%; }
    .services-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .service-card {
        flex-direction: row;
        text-align: left;
        padding: 1.25rem;
        gap: 16px;
    }
    .service-icon {
        width: 52px;
        height: 52px;
        flex-shrink: 0;
    }
    .service-card-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
}

@media (max-width: 640px) {
    .welcome-greeting,
    .welcome-subtitle {
        font-size: 1.4rem;
    }

    .lang-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 280px;
    }

    .chat-welcome h1 { font-size: 1.5rem; }
    .chat-welcome .subtitle { font-size: 1.1rem; }

    .chips-container {
        justify-content: flex-start;
        padding: .75rem 16px;
    }

    .chip {
        font-size: .8rem;
        padding: 8px 14px;
    }

    .msg { max-width: 92%; }

    .form-card { padding: 1.25rem; }

    .action-cards {
        grid-template-columns: 1fr;
    }

    .ocr-preview {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }
    .btn-group .btn { width: 100%; }

    .data-list {
        grid-template-columns: 1fr;
        gap: 4px 0;
    }
    .data-list dt { font-weight: 600; }
    .data-list dd { margin-bottom: 8px; }

    .fab {
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 600px) {
    .app-header {
        padding: 0 10px;
        gap: 6px;
    }
    .app-header .logo span {
        display: none;
    }
    .app-header .logo img {
        height: 64px;
    }
    .header-right {
        gap: 6px;
    }
    .header-right a[href*="portal"] {
        padding: 6px 10px;
        font-size: .72rem;
    }
    .lang-switcher {
        padding: 5px 8px;
        font-size: .75rem;
    }
}

@media (max-width: 480px) {
    .app-header { padding: 0 8px; }
    .chat-input-area { padding: 6px 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   HTMX INTEGRATION
   ═══════════════════════════════════════════════════════════════ */

.htmx-indicator {
    display: none;
}
.htmx-indicator.htmx-request {
    display: inline-flex;
}
.htmx-request .hide-on-request {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING OVERLAY (OCR, uploads)
   ═══════════════════════════════════════════════════════════════ */

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(247, 248, 250, 0.9);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}
.loading-overlay.active {
    display: flex;
}
.loading-overlay .spinner-large {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.loading-overlay .loading-text {
    color: var(--text-secondary);
    font-size: .95rem;
    text-align: center;
}

/* Typing bubble in chat */
.typing-bubble {
    display: none;
    align-self: flex-start;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn .25s ease;
}
.typing-bubble.active {
    display: flex;
}
