/* ======================================
   Figli Landing Pages - Shared Styles
   ====================================== */

/* ======================================
   Reset & Base
   ====================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-purple: #8b7bf7;
    --accent-green: #bfff00;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ======================================
   Header
   ====================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #222;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-cta {
    background: var(--accent-green);
    color: #000;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.header-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(191, 255, 0, 0.3);
}

.header-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.header-link:hover {
    color: var(--text-primary);
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Header Auth */
.header-auth {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-login {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.header-login:hover {
    color: var(--text-primary);
}

.header-user-name {
    color: var(--text-primary);
    font-weight: 500;
}

.header-logout {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.header-logout:hover {
    color: var(--text-primary);
}

/* ======================================
   Main Layout
   ====================================== */
.main {
    max-width: 700px;
    margin: 0 auto;
    padding: 120px 24px 60px;
}

/* ======================================
   Hero Section
   ====================================== */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero-icon {
    font-size: 48px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ======================================
   Widget Container
   ====================================== */
.widget {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid #333;
}

/* ======================================
   Form Inputs
   ====================================== */

/* Main text input */
.main-input {
    margin-bottom: 24px;
}

.main-input label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
}

.main-input textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
    min-height: 140px;
}

.main-input textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.main-input textarea::placeholder {
    color: #666;
}

.input-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Context/Additional input */
.context-input,
.additional-input {
    margin-bottom: 24px;
}

.context-input label,
.additional-input label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.context-input textarea,
.additional-input textarea,
.additional-input input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
}

.context-input textarea,
.additional-input textarea {
    resize: vertical;
    min-height: 80px;
}

.context-input textarea:focus,
.additional-input textarea:focus,
.additional-input input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.context-input textarea::placeholder,
.additional-input textarea::placeholder,
.additional-input input::placeholder {
    color: #666;
}

/* ======================================
   Profile Row (Gender & Age)
   ====================================== */
.profile-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.profile-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.gender-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.gender-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-secondary);
    border-radius: 8px;
}

.gender-btn:hover {
    color: var(--text-primary);
}

.gender-btn.active {
    background: var(--accent-purple);
    color: white;
}

.age-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.age-group label {
    font-size: 14px;
    color: var(--text-secondary);
}

.age-input {
    width: 70px;
    background: var(--bg-secondary);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    text-align: center;
}

.age-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

/* ======================================
   Upload Components
   ====================================== */

/* Full upload zone */
.upload-zone {
    border: 2px dashed #444;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 24px;
}

.upload-zone:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 123, 247, 0.05);
}

.upload-zone.dragover {
    border-color: var(--accent-green);
    background: rgba(191, 255, 0, 0.05);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: var(--accent-green);
    background: rgba(191, 255, 0, 0.05);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.upload-zone h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-formats {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.format-badge {
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Compact upload */
.upload-compact {
    border: 1px dashed #444;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 24px;
}

.upload-compact:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 123, 247, 0.05);
}

.upload-compact.has-file {
    border-style: solid;
    border-color: var(--accent-green);
    background: rgba(191, 255, 0, 0.05);
}

.upload-compact-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.upload-compact p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* File preview */
.file-preview {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 24px;
}

.file-preview.visible {
    display: flex;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
}

.file-remove:hover {
    color: #ff6b6b;
}

/* Compact file preview */
.file-preview-compact {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-top: 12px;
}

.file-preview-compact.visible {
    display: flex;
}

.file-preview-compact span {
    flex: 1;
    font-size: 14px;
}

.file-preview-compact button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

.file-preview-compact button:hover {
    color: #ff6b6b;
}

/* ======================================
   Divider
   ====================================== */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #333;
}

/* ======================================
   Buttons
   ====================================== */
.submit-btn {
    width: 100%;
    background: var(--accent-green);
    color: #000;
    padding: 16px 32px;
    border-radius: 100px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(191, 255, 0, 0.3);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form consent text */
.form-consent {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-consent a {
    color: var(--text-secondary);
    text-decoration: underline;
    transition: color 0.2s;
}

.form-consent a:hover {
    color: var(--text-primary);
}

/* ======================================
   Results
   ====================================== */
.results {
    display: none;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #333;
}

.results.visible {
    display: block;
}

.results-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.results-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    line-height: 1.7;
}

.results-content p {
    margin-bottom: 16px;
}

.results-content p:last-child {
    margin-bottom: 0;
}

/* ======================================
   Summary & Info Blocks
   ====================================== */
.summary-block {
    background: linear-gradient(90deg, rgba(139, 123, 247, 0.1) 0%, transparent 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--accent-purple);
}

.summary-block h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.summary-block p {
    font-size: 14px;
    line-height: 1.6;
}

.summary-block ul {
    list-style: none;
    font-size: 14px;
}

.summary-block li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.summary-block li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
}

/* ======================================
   Save Prompt
   ====================================== */
.save-prompt {
    display: none;
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    text-align: center;
}

.save-prompt.visible {
    display: block;
}

.save-prompt p {
    margin-bottom: 16px;
}

.save-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.save-btn {
    padding: 12px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.save-btn.primary {
    background: var(--accent-purple);
    color: white;
}

.save-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ======================================
   Disclaimer
   ====================================== */
.disclaimer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* ======================================
   Footer
   ====================================== */
.footer {
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid #222;
}

.footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-support {
    margin-bottom: 16px;
    font-size: 14px;
}

.footer-support a {
    color: var(--accent-purple);
    text-decoration: none;
}

.footer-support a:hover {
    text-decoration: underline;
}

.footer p.footer-company {
    margin-top: 8px;
    font-size: 12px;
    color: #444;
}

.footer p.footer-disclaimer {
    margin-top: 12px;
    font-size: 12px;
    color: #444;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ======================================
   Chat Styles
   ====================================== */
.chat-container {
    margin-top: 32px;
}

/* Connection Status Bar */
.chat-status {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #333;
}

#chatConnectionStatus {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connecting {
    background: #ffc107;
    animation: pulse 1.5s infinite;
}

.status-dot.connected {
    background: var(--accent-green);
}

.status-dot.disconnected {
    background: #ff6b6b;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Messages Container */
.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Loading State */
.chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.chat-loading p {
    font-size: 14px;
    margin: 0;
}

/* Individual Messages */
.chat-message {
    display: flex;
    animation: messageSlideIn 0.3s ease-out;
}

.chat-message.hidden {
    display: none;
}

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

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.chat-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
}

.chat-message.user .chat-message-content {
    background: var(--accent-green);
    color: #000;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-message-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid #333;
    border-bottom-left-radius: 4px;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.chat-message-author {
    font-weight: 600;
}

.chat-message.user .chat-message-author {
    color: #000;
}

.chat-message.assistant .chat-message-author {
    color: var(--accent-purple);
}

.chat-message-time {
    opacity: 0.7;
    font-size: 11px;
    margin-left: 12px;
}

.chat-message-text {
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Markdown elements in chat messages */
.chat-message-text p {
    margin: 0 0 12px 0;
}

.chat-message-text p:last-child {
    margin-bottom: 0;
}

.chat-message-text strong {
    font-weight: 600;
}

.chat-message-text em {
    font-style: italic;
}

.chat-message-text a {
    color: var(--accent-purple);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.chat-message-text a:hover {
    opacity: 0.8;
}

.chat-message.user .chat-message-text a {
    color: #000;
    font-weight: 600;
}

.chat-message-text ul,
.chat-message-text ol {
    margin: 8px 0;
    padding-left: 24px;
}

.chat-message-text ul {
    list-style-type: disc;
}

.chat-message-text ol {
    list-style-type: decimal;
}

.chat-message-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.chat-message-text ul ul,
.chat-message-text ol ol,
.chat-message-text ul ol,
.chat-message-text ol ul {
    margin: 4px 0;
}

/* Thinking Bubble */
.chat-thinking-bubble {
    display: flex;
    justify-content: flex-start;
    animation: messageSlideIn 0.3s ease-out;
}

.chat-thinking-bubble-content {
    background: var(--bg-secondary);
    border: 1px solid #333;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    padding: 16px 20px;
}

.thinking-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 0.9s infinite ease-in-out;
}

.thinking-dot:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Input Area */
.chat-input-area {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #333;
}

#chatMessageForm {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-attach-btn {
    background: transparent;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition:
        border-color 0.2s,
        opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
}

.chat-attach-btn:hover:not(:disabled) {
    border-color: var(--accent-purple);
}

.chat-attach-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-attach-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.chat-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.chat-input::placeholder {
    color: #666;
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn {
    background: var(--accent-green);
    color: #000;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    white-space: nowrap;
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(191, 255, 0, 0.3);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Telegram Login Prompt */
.telegram-login-prompt {
    padding: 20px;
    margin: 20px 20px 0 0;
    background: linear-gradient(90deg, rgba(0, 136, 204, 0.1) 0%, transparent 100%);
    border-radius: 12px;
    border-left: 0;
    text-align: center;
}

/* Telegram Success Message */
.telegram-success-message {
    padding: 20px;
    margin: 20px 20px 0 0;
    background: linear-gradient(90deg, rgba(0, 136, 204, 0.1) 0%, transparent 100%);
    border-radius: 12px;
    border-left: 0;
    text-align: center;
    font-size: 15px;
    animation: messageSlideIn 0.3s ease-out;
}

.telegram-success-message a {
    color: var(--accent-green);
    text-decoration: underline;
    font-weight: 600;
}

.telegram-prompt-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

#telegramLoginButton {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Toast Notifications */
.figli-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-green);
    color: #000;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(191, 255, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    white-space: nowrap;
}

.figli-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Chat Input Disabled State */
.chat-input-disabled-state {
    padding: 24px 20px;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #333;
    text-align: center;
}

.chat-input-disabled-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.chat-input-disabled-login {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Login Modal */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.login-modal {
    background: var(--bg-secondary);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 40px 32px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s ease;
}

.login-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.login-close-btn:hover {
    color: var(--text-primary);
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.login-option--hidden {
    display: none;
}

/* Email login button */
.login-email-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s;
}

.login-email-btn:hover {
    background: var(--bg-secondary);
    border-color: #444;
}

.login-divider {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-coming-soon {
    font-size: 12px;
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Email login form */
.login-email-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-email-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: -4px;
}

.login-email-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid #333;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.login-email-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.login-email-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Code input */
.login-code-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

.login-code-container {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.login-code-box {
    width: 48px;
    height: 56px;
    background: var(--bg-primary);
    border: 2px solid #333;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
    transition:
        border-color 0.2s,
        transform 0.1s;
}

.login-code-box:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.login-code-box--error {
    border-color: #ff4d4d;
    animation: shake 0.5s;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

/* Submit button */
.login-submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--accent-purple);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition:
        background 0.2s,
        opacity 0.2s;
}

.login-submit-btn:hover:not(:disabled) {
    background: #9d8bff;
}

.login-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error message */
.login-error {
    color: #ff4d4d;
    font-size: 14px;
    text-align: center;
    display: none;
    line-height: 1.4;
}

/* ======================================
   Legal Pages
   ====================================== */
.legal-page {
    padding-top: 100px;
}

.legal-page h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.legal-page .legal-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.legal-content {
    line-height: 1.7;
    font-size: 15px;
}

.legal-content p {
    margin-bottom: 16px;
}

.legal-content ol,
.legal-content ul {
    margin-bottom: 16px;
    padding-left: 24px;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content ol ol,
.legal-content ul ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

.legal-content strong {
    font-weight: 600;
}

.legal-content a {
    color: var(--accent-purple);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--accent-purple);
    background: rgba(139, 123, 247, 0.1);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.legal-content blockquote p {
    margin-bottom: 0;
}

/* Footer legal links */
.footer-legal {
    margin-bottom: 16px;
    font-size: 13px;
}

.footer-legal a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: var(--text-primary);
}

/* ======================================
   Responsive Design
   ====================================== */
@media (max-width: 600px) {
    .header {
        padding: 16px 20px;
        box-sizing: border-box;
    }

    .header-cta {
        display: none;
    }

    .header-auth {
        display: flex;
    }

    /* Show only icon on mobile for login */
    .header-login {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0;
        background: var(--bg-card);
        border: 1px solid #333;
        border-radius: 8px;
        transition: background 0.2s;
    }

    .header-login::before {
        content: '👤';
        font-size: 18px;
    }

    .header-login:hover {
        background: var(--bg-secondary);
    }

    /* Mobile: User name + logout */
    .header-user-name {
        font-size: 14px;
    }

    .header-logout {
        font-size: 14px;
    }

    .main {
        padding: 100px 16px 40px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 17px;
    }

    .widget {
        padding: 24px 16px;
    }

    .chat-messages {
        height: 300px;
        padding: 16px;
        gap: 12px;
    }

    .chat-message-content {
        max-width: 85%;
        padding: 10px 14px;
    }

    .chat-input-area {
        padding: 12px 16px;
    }

    /* Mobile: Wrap layout - textarea on top, buttons below */
    #chatMessageForm {
        flex-wrap: wrap;
        gap: 8px;
    }

    .chat-input {
        font-size: 16px; /* Prevents iOS zoom */
        flex-basis: 100%;
        order: 1;
    }

    /* Mobile: Buttons side-by-side below textarea */
    .chat-attach-btn {
        order: 2;
        flex: 0 0 auto;
    }

    .chat-send-btn {
        padding: 12px 16px;
        font-size: 14px;
        order: 3;
        flex: 1;
    }

    .telegram-login-prompt {
        margin: 12px 16px 0;
        padding: 16px;
    }

    .telegram-prompt-text {
        font-size: 13px;
    }

    .figli-toast {
        bottom: 20px;
        font-size: 14px;
        padding: 12px 20px;
        max-width: calc(100% - 40px);
        white-space: normal;
        text-align: center;
    }

    .chat-input-disabled-state {
        padding: 20px 16px;
    }

    .chat-input-disabled-text {
        font-size: 13px;
    }

    .login-modal {
        padding: 32px 24px;
        margin: 0 16px;
    }

    .login-title {
        font-size: 20px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .login-code-box {
        width: 44px;
        height: 52px;
        font-size: 22px;
    }

    .login-code-container {
        gap: 6px;
    }
}
