/* ── AI Marketing OS — Chat UI ─────────────────────────── */

.amos-wrap {
    max-width: 780px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
}

/* ── Progress bar ───────────────────────────────────────── */
.amos-progress {
    padding: 20px 0 24px;
}

.amos-progress-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.amos-stage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.amos-stage-item span {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    white-space: nowrap;
}

.amos-stage-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    z-index: 1;
}

.amos-stage-item.active .amos-stage-dot {
    background: #534AB7;
    border-color: #534AB7;
    box-shadow: 0 0 0 3px rgba(83,74,183,0.2);
}

.amos-stage-item.active span {
    color: #534AB7;
    font-weight: 600;
}

.amos-stage-item.done .amos-stage-dot {
    background: #1D9E75;
    border-color: #1D9E75;
}

.amos-stage-item.done span {
    color: #1D9E75;
}

.amos-stage-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    min-width: 32px;
    max-width: 80px;
    margin-bottom: 20px;
    transition: background 0.3s ease;
}

.amos-stage-line.done {
    background: #1D9E75;
}

/* ── Chat window ────────────────────────────────────────── */
.amos-chat-window {
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 24px;
    min-height: 420px;
    max-height: 540px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* ── Message bubbles ─────────────────────────────────────── */
.amos-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: amos-fadein 0.2s ease;
}

@keyframes amos-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.amos-message.user {
    flex-direction: row-reverse;
}

.amos-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #534AB7;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Logo image avatar for the bot */
img.amos-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    padding: 2px;
    flex-shrink: 0;
}

.amos-message.user .amos-avatar {
    background: #1D9E75;
}

.amos-bubble {
    max-width: 72%;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.65;
    color: #1a1a1a;
    white-space: pre-wrap;
    word-break: break-word;
}

.amos-message.user .amos-bubble {
    background: #534AB7;
    color: #fff;
    border-color: #534AB7;
    border-radius: 16px 16px 4px 16px;
}

/* ── Formatted content inside assistant bubbles ──────────── */
.amos-bubble h2.amos-h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 14px 0 6px;
    color: #1a1a1a;
    line-height: 1.3;
}

.amos-bubble h3.amos-h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 12px 0 4px;
    color: #333;
}

.amos-bubble h4.amos-h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 10px 0 4px;
    color: #444;
}

.amos-bubble p {
    margin: 0 0 8px;
}

.amos-bubble p:last-child {
    margin-bottom: 0;
}

.amos-bubble strong {
    font-weight: 600;
    color: #1a1a1a;
}

.amos-bubble em {
    font-style: italic;
}

.amos-bubble ul.amos-ul,
.amos-bubble ol.amos-ol {
    margin: 6px 0 10px;
    padding-left: 20px;
}

.amos-bubble li.amos-li,
.amos-bubble li.amos-li-num {
    margin-bottom: 4px;
    line-height: 1.5;
}

.amos-bubble hr.amos-hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 12px 0;
}

.amos-bubble pre.amos-code {
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    margin: 8px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.amos-bubble code.amos-inline-code {
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
}

.amos-bubble a {
    color: #534AB7;
    text-decoration: underline;
}

.amos-bubble a:hover {
    color: #3C3489;
}

/* Stage advance notification */
.amos-stage-advance {
    text-align: center;
    padding: 8px 16px;
    font-size: 12px;
    color: #1D9E75;
    font-weight: 500;
    background: #e8f5e9;
    border-radius: 20px;
    align-self: center;
}

/* Section approved notification (within a stage) */
.amos-section-notice {
    text-align: center;
    padding: 6px 14px;
    font-size: 11px;
    color: #534AB7;
    font-weight: 500;
    background: #ede9fb;
    border-radius: 16px;
    align-self: center;
}

/* Deploy action notification */
.amos-deploy-notice {
    text-align: center;
    padding: 8px 18px;
    font-size: 12px;
    color: #185FA5;
    font-weight: 500;
    background: #e3f2fd;
    border-radius: 20px;
    align-self: center;
    border: 1px solid #b3d9f7;
}

/* ── Section progress dots (under progress bar) ──────────── */
.amos-section-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0 0 8px;
    margin-top: -8px;
}

.amos-sdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    cursor: help;
}

.amos-sdot.done {
    background: #534AB7;
    box-shadow: 0 0 0 2px rgba(83,74,183,0.15);
}

/* ── Typing indicator ─────────────────────────────────────── */
.amos-typing {
    display: flex;
    gap: 10px;
    align-items: center;
}

.amos-typing-dots {
    display: flex;
    gap: 4px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px 16px 16px 4px;
}

.amos-typing-dot {
    width: 7px;
    height: 7px;
    background: #bbb;
    border-radius: 50%;
    animation: amos-bounce 1.2s infinite ease-in-out;
}

.amos-loading-init {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.amos-loading-init .amos-typing-dot {
    width: 9px;
    height: 9px;
}

.amos-typing-dot:nth-child(1) { animation-delay: 0s; }
.amos-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.amos-typing-dot:nth-child(3) { animation-delay: 0.36s; }

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

/* ── Input area ──────────────────────────────────────────── */
.amos-input-area {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    align-items: flex-end;
}

.amos-textarea {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s;
    background: #fff;
    color: #1a1a1a;
}

.amos-textarea:focus {
    border-color: #534AB7;
}

.amos-textarea::placeholder {
    color: #aaa;
}

.amos-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #534AB7;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}

.amos-send-btn:hover  { background: #3C3489; }
.amos-send-btn:active { transform: scale(0.95); }
.amos-send-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ── Footer ──────────────────────────────────────────────── */
.amos-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 0 2px;
}

#amos-stage-label {
    font-size: 12px;
    color: #888;
}

.amos-link-btn {
    background: none;
    border: none;
    color: #534AB7;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.amos-link-btn:hover { color: #3C3489; }

/* ── Login prompt ────────────────────────────────────────── */
.amos-login-prompt {
    text-align: center;
    padding: 48px 32px;
    background: #f8f8f8;
    border-radius: 16px;
    color: #555;
}

.amos-login-prompt h3 {
    font-size: 18px;
    color: #1a1a1a;
    margin: 12px 0 6px;
}

.amos-login-prompt p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px;
}

.amos-btn-login,
.amos-btn-register {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin: 4px;
    transition: background 0.2s, color 0.2s;
}

.amos-btn-login {
    background: #534AB7;
    color: #fff;
}

.amos-btn-login:hover {
    background: #3C3489;
    color: #fff;
}

.amos-btn-register {
    background: #fff;
    color: #534AB7;
    border: 1.5px solid #534AB7;
}

.amos-btn-register:hover {
    background: #f0edff;
}

/* ── Credits display ────────────────────────────────────── */
#amos-credits {
    font-size: 11px;
    color: #888;
    background: #f4f4f4;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Credits error banner in chat */
.amos-credits-error {
    text-align: center;
    padding: 12px 18px;
    font-size: 13px;
    color: #c62828;
    background: #fce4ec;
    border-radius: 12px;
    align-self: center;
    border: 1px solid #f8bbd0;
}

.amos-credits-error a {
    color: #534AB7;
    text-decoration: underline;
    font-weight: 500;
}

.amos-credits-error a:hover {
    color: #3C3489;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .amos-chat-window { padding: 16px; min-height: 340px; }
    .amos-bubble      { max-width: 86%; }
    .amos-stage-line  { min-width: 16px; }
    .amos-stage-item span { font-size: 10px; }
}
