:root {
    --primary-gray: #2d3748;
    --light-gray: #f7fafc;
    --border-gray: #e2e8f0;
    --text-gray: #2d3748;
    --orange: #f97316;
    --orange-hover: #ea580c;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--text-gray);
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    align-items: center;
    justify-content: center;
}

.chat-container {
    width: 100%;
    max-width: 600px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

.chat-header {
    background: var(--orange);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.chat-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--white);
    background: var(--white);
}

.chat-header h2 {
    font-weight: 600;
    font-size: 1.2rem;
}

.user-badge {
    font-size: 0.85rem;
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
}

.login-btn {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.4);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

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

.logout-btn {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.4);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 8px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #ff6b6b;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--light-gray);
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.bot-message {
    background: var(--white);
    align-self: flex-start;
    border: 1px solid var(--border-gray);
    border-left: 4px solid var(--orange);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.user-message {
    background: var(--orange);
    color: var(--white);
    align-self: flex-end;
    border-right: 4px solid var(--primary-gray);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--border-gray);
    background: var(--white);
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    outline: none;
    font-size: 16px;
}

.chat-input input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.chat-input button {
    background: var(--orange);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.chat-input button:hover {
    background: var(--orange-hover);
}

footer {
    margin-top: 20px;
    text-align: center;
    color: var(--text-gray);
    font-size: 0.85rem;
}

.bot-message strong {
    font-weight: 600;
    color: var(--orange);
}

.bot-message em {
    font-style: italic;
}

.bot-message ul,
.bot-message ol {
    margin: 8px 0;
    padding-left: 20px;
}

.bot-message li {
    margin: 4px 0;
}

/* Modal de Login */
#loginModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--orange);
}

.modal-content p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.modal-content label {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #555;
}

.modal-content button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin: 5px 5px 0;
}

.btn-primary {
    background: #007bff;
    color: white;
    width: 100%;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}
