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

:root {
    /* AiMi Bronze/Anthrazit Theme */
    --aimi-bg:          #0D0D0D;
    --aimi-elevated:    #1A1A1A;
    --aimi-input:       #2D2D2D;
    --aimi-user-msg:    #3A3632;
    --aimi-bronze:      #D4A574;
    --aimi-bronze-dark: #A67C52;
    --aimi-border:      rgba(255,255,255,0.08);
    --aimi-text:        #FFFFFF;
    --aimi-muted:       #808080;
    --aimi-secondary:   #B8B8B8;

    /* Landing colors */
    --bg:       #0d0d0d;
    --accent:   #3b82f6;
    --text:     #ffffff;
    --muted:    #888888;
    --soft:     #cccccc;
    --border:   rgba(255,255,255,0.09);
    --card:     #1a1a1a;
    --radius:   12px;
}

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== NAV ===== */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(13,13,13,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    height: 58px;
    display: flex;
    align-items: center;
}

.nav-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--aimi-bronze);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-logo sup { font-size: 0.5em; vertical-align: super; }

.nav-links { display: flex; align-items: center; gap: 28px; }

.nav-links a {
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.btn-nav {
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
    padding: 7px 18px;
    border-radius: 8px;
    font-weight: 500 !important;
}

.btn-nav:hover { border-color: rgba(255,255,255,0.2) !important; }

/* ===== HERO ===== */
.hero {
    flex: 1;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 48px;
    align-items: center;
    max-width: 1500px;
    margin: 0 auto;
    padding: 80px 40px 40px;
    width: 100%;
}

/* LEFT */
.hero-left { display: flex; flex-direction: column; gap: 22px; }

.hero-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.03em;
}

.hero-left h1 {
    font-size: clamp(2.2rem, 3.5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.hero-sub {
    font-size: 0.95rem;
    color: var(--soft);
    line-height: 1.65;
}

.hero-sub sup { font-size: 0.6em; vertical-align: super; }

/* FORM */
.register-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: #1f1f1f;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit; font-size: 0.9rem; font-weight: 500;
    padding: 11px 16px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.btn-google:hover { border-color: rgba(255,255,255,0.2); background: #252525; }

.form-divider {
    display: flex; align-items: center; gap: 10px;
    color: var(--muted); font-size: 0.72rem;
}

.form-divider::before, .form-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.register-form input[type="email"] {
    background: #1f1f1f;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit; font-size: 0.9rem;
    padding: 11px 14px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.register-form input::placeholder { color: var(--muted); }
.register-form input:focus { border-color: rgba(255,255,255,0.25); }

.register-form button[type="submit"] {
    background: var(--text);
    color: #000;
    border: none;
    border-radius: 8px;
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    padding: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.register-form button[type="submit"]:hover { background: #e5e5e5; }

.form-hint {
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

.form-hint a { color: var(--muted); text-decoration: underline; }

.trust-pills { display: flex; gap: 14px; flex-wrap: wrap; }
.trust-pills span { font-size: 0.78rem; color: var(--muted); }

.login-hint { font-size: 0.85rem; color: var(--muted); }
.login-hint a { color: var(--soft); text-decoration: none; font-weight: 500; }
.login-hint a:hover { color: var(--text); }

/* ===== AIMI WINDOW ===== */
.hero-right {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.aimi-window {
    width: 100%;
    max-width: 920px;
    background: var(--aimi-bg);
    border: 1px solid rgba(212,165,116,0.15);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,165,116,0.08);
    display: flex;
    flex-direction: column;
    height: 520px;
}

/* Titlebar */
.aimi-titlebar {
    background: #141414;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.win-dots { display: flex; gap: 7px; align-items: center; }

.win-dots .dot {
    width: 12px; height: 12px; border-radius: 50%;
}

.win-dots .dot.red    { background: #ff5f57; }
.win-dots .dot.yellow { background: #febc2e; }
.win-dots .dot.green  { background: #28c840; }

.aimi-win-logo { height: 22px; margin-left: 8px; }

/* App Layout */
.aimi-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.aimi-sidebar {
    width: 200px;
    background: #111111;
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    gap: 2px;
    flex-shrink: 0;
    overflow: hidden;
}

.sb-logo {
    padding: 4px 12px 8px;
    display: flex;
    align-items: center;
}

.sb-logo img {
    height: 24px;
    object-fit: contain;
}

.sb-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 6px 10px;
}

.sb-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    font-size: 0.75rem;
    color: var(--aimi-secondary);
    cursor: pointer;
    border-radius: 6px;
    margin: 0 6px;
    transition: background 0.15s, color 0.15s;
}

.sb-nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--aimi-text);
}

.sb-nav-item.active {
    background: rgba(212,165,116,0.08);
    color: var(--aimi-bronze);
}

.sb-nav-item svg { flex-shrink: 0; }

.sb-section {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--aimi-muted);
    padding: 8px 14px 4px;
}

.sb-project-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: 0.72rem;
    color: var(--aimi-secondary);
    cursor: pointer;
    border-radius: 6px;
    margin: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-project-item:hover { background: rgba(255,255,255,0.04); }

.sb-chat-item {
    padding: 5px 14px;
    font-size: 0.72rem;
    color: var(--aimi-muted);
    cursor: pointer;
    border-radius: 6px;
    margin: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s, color 0.15s;
}

.sb-chat-item:hover { background: rgba(255,255,255,0.04); color: var(--aimi-secondary); }
.sb-chat-item.active { color: var(--aimi-text); }

/* Chat Area */
.aimi-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar { display: none; }

/* User message */
.msg-user {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 10px;
}

.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--aimi-bronze-dark);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    order: 2;
}

.user-bubble {
    background: var(--aimi-user-msg);
    border: 1px solid rgba(212,165,116,0.15);
    border-radius: 16px 4px 16px 16px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--aimi-text);
    line-height: 1.5;
    max-width: 85%;
    min-height: 20px;
}

/* Thinking */
.msg-thinking {
    display: none;
    align-items: center;
    gap: 10px;
}

.thinking-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--aimi-elevated);
    border-radius: 4px 16px 16px 16px;
    padding: 10px 14px;
}

.thinking-dots span:not(.thinking-label) {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--aimi-bronze);
    opacity: 0.4;
    animation: thinkPulse 1.2s infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

.thinking-label {
    font-size: 0.75rem;
    color: var(--aimi-muted);
    margin-left: 4px;
}

@keyframes thinkPulse {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* AiMi message */
.msg-aimi {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    opacity: 0;
}

.aimi-avatar {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: rgba(212,165,116,0.15);
    border: 1px solid rgba(212,165,116,0.25);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.aimi-avatar img { width: 18px; height: 18px; object-fit: contain; }
.aimi-avatar span {
    display: none;
    font-size: 0.7rem; font-weight: 700;
    color: var(--aimi-bronze);
}

.aimi-response {
    flex: 1;
    min-width: 0;
}

#response-content {
    font-size: 0.8rem;
    color: var(--aimi-text);
    line-height: 1.6;
}

#response-content p {
    margin-bottom: 8px;
}

#response-content p:last-child { margin-bottom: 0; }

.table-note {
    font-size: 0.75rem !important;
    color: var(--aimi-secondary) !important;
    margin-top: 8px !important;
}

/* AiMi Table */
.aimi-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.aimi-table th {
    background: rgba(212,165,116,0.08);
    color: var(--aimi-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.aimi-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--aimi-secondary);
}

.aimi-table tr:last-child td { border-bottom: none; }

.aimi-table td.highlight,
.aimi-table th.highlight {
    color: var(--aimi-bronze);
    font-weight: 600;
}

.aimi-table td.copper { color: var(--aimi-bronze); }
.aimi-table td.green-text { color: #4ade80; }
.aimi-table td.red-text { color: #f87171; }

/* Source */
.response-source {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    opacity: 0;
}

.src-badge {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(212,165,116,0.1);
    color: var(--aimi-bronze);
    border: 1px solid rgba(212,165,116,0.2);
    padding: 2px 7px;
    border-radius: 4px;
}

#src-text {
    font-size: 0.72rem;
    color: var(--aimi-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Chat Input */
.chat-input-bar {
    padding: 10px 16px 14px;
    flex-shrink: 0;
}

.chat-input {
    background: var(--aimi-input);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-placeholder {
    font-size: 0.78rem;
    color: var(--aimi-muted);
}

.send-btn {
    width: 30px; height: 30px;
    background: var(--aimi-bronze);
    border: none;
    border-radius: 7px;
    color: #1a1a1a;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.send-btn:hover { background: var(--aimi-bronze-dark); }

/* ===== BERECHNUNGS PANEL ===== */
.aimi-panel {
    width: 0;
    background: #111111;
    border-left: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
    transition: width 0.4s ease;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.aimi-panel.visible { width: 200px; }

.panel-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.panel-tab {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 0.68rem;
    color: var(--aimi-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.panel-tab.active {
    color: var(--aimi-bronze);
    border-bottom-color: var(--aimi-bronze);
}

.panel-content {
    padding: 14px 12px;
    font-size: 0.72rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: none;
}

.panel-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--aimi-muted);
    margin-bottom: 4px;
}

.panel-val {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--aimi-text);
    margin-bottom: 14px;
}

.panel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(212,165,116,0.06);
    border: 1px solid rgba(212,165,116,0.12);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 0.7rem;
    color: var(--aimi-secondary);
}

.panel-result {
    color: var(--aimi-bronze);
    font-weight: 600;
    font-size: 0.8rem;
}

.panel-expand { font-size: 0.6rem; margin-left: 2px; }

.panel-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.pd-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--aimi-muted);
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.pd-row.highlight { color: var(--aimi-bronze); font-weight: 600; }

.panel-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.pa-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    color: var(--aimi-secondary);
    font-family: inherit;
    font-size: 0.62rem;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.pa-btn:hover { background: rgba(255,255,255,0.1); }

.pa-btn.accent {
    background: rgba(212,165,116,0.1);
    border-color: rgba(212,165,116,0.2);
    color: var(--aimi-bronze);
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 18px 40px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.footer span, .footer nav a {
    font-size: 0.76rem;
    color: var(--muted);
    text-decoration: none;
}

.footer nav { display: flex; gap: 22px; }
.footer nav a:hover { color: var(--soft); }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 80px 24px 40px;
    }
    .hero-right { display: none; }
    .nav { padding: 0 24px; }
    .nav-links a:not(.btn-nav) { display: none; }
    .footer { padding: 18px 24px; }
}
