:root {
    /* NICCOM brand tokens (legacy aliases kept for existing components). */
    --cream: var(--niccom-surface-muted, #edf3f9);
    --cream-dark: var(--niccom-bg, #f4f7fb);
    --lime: var(--niccom-accent, #16a6d9);
    --lime-hover: var(--niccom-accent-strong, #0785b5);
    --lime-dark: var(--niccom-primary, #012454);
    --purple: var(--niccom-primary, #012454);
    --purple-light: var(--niccom-accent, #16a6d9);
    --blue: var(--niccom-accent, #16a6d9);
    --party-purple: var(--niccom-primary, #012454);
    --party-pink: var(--niccom-accent, #16a6d9);
    --party-orange: var(--niccom-accent-strong, #0785b5);
    --gradient-bg: var(--niccom-bg, #f4f7fb);
    --gradient-accent: var(--niccom-gradient, linear-gradient(135deg, #012454, #16a6d9));
    --neutral-dark: var(--niccom-text, #10233f);
    --neutral-medium: var(--niccom-text-muted, #5f6f84);
    --neutral-light: var(--niccom-text-muted, #5f6f84);
    --glass-bg: color-mix(in srgb, var(--niccom-surface, #fff) 78%, transparent);
    --glass-border: var(--niccom-border, #d8e2ee);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Modern, Elegant Design */

body {
    background: var(--gradient-bg);
    color: var(--neutral-dark);
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--neutral-dark);
}

/* Modern Buttons */
.aws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: var(--niccom-surface, white);
    border: 1px solid var(--niccom-border, #d8e2ee);
    color: var(--neutral-dark);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    border-radius: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.aws-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(184, 232, 3, 0.1));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.aws-btn:hover::before {
    opacity: 1;
}

.aws-btn:hover {
    border-color: var(--lime);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.aws-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.aws-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--niccom-accent, #16a6d9) 18%, transparent);
}

.aws-btn-primary {
    background: var(--gradient-accent);
    border: none;
    color: white;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.aws-btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(184, 232, 3, 0.35);
}

/* Chat messages */
.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    animation: slideIn 0.4s ease-out;
}

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

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

.message-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bot-message .message-icon {
    background: var(--gradient-accent);
    color: white;
    box-shadow: var(--shadow-md);
}

.user-message .message-icon {
    background: var(--niccom-primary, #012454);
    color: white;
    box-shadow: var(--shadow-md);
}

.message-text {
    max-width: 75%;
    padding: 18px 24px;
    border-radius: 24px;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.message-text:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.bot-message .message-text {
    background: var(--niccom-surface, white);
    border: 1px solid rgba(0,0,0,0.06);
    color: var(--neutral-dark);
}

.bot-message .message-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-accent);
    border-radius: 24px 0 0 24px;
}

.user-message .message-text {
    background: var(--gradient-accent);
    color: white;
    border: none;
    font-weight: 500;
}

.message-text strong {
    font-weight: 700;
}

.message-text a {
    color: var(--niccom-accent-strong, #0785b5);
    text-decoration: none;
}

.message-text a:hover {
    text-decoration: underline;
}

.user-message .message-text a {
    color: #fff;
    text-decoration: underline;
}

/* Feedback Buttons - Enhanced */
.feedback-container {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.feedback-btn {
    background: color-mix(in srgb, var(--niccom-accent, #16a6d9) 10%, transparent);
    backdrop-filter: blur(5px);
    border: 1px solid color-mix(in srgb, var(--niccom-accent, #16a6d9) 30%, transparent);
    border-radius: 8px;
    color: var(--party-purple);
    cursor: pointer;
    padding: 6px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.feedback-btn:hover {
    background: color-mix(in srgb, var(--niccom-accent, #16a6d9) 20%, transparent);
    border-color: var(--party-purple);
    transform: scale(1.1);
}

.feedback-btn.active {
    background: var(--party-purple);
    color: white;
    border-color: var(--party-purple);
}

/* File Preview */
.file-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--niccom-accent, #16a6d9) 10%, transparent);
    backdrop-filter: blur(10px);
    border: 1px solid color-mix(in srgb, var(--niccom-accent, #16a6d9) 30%, transparent);
    border-radius: 12px;
    gap: 10px;
}

.file-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
}

.file-preview i {
    font-size: 32px;
    color: var(--party-purple);
}

.remove-file {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--niccom-danger, #c53b4a);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.remove-file:hover {
    transform: scale(1.2) rotate(90deg);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.5);
}

/* Card / Container Style - Modern Glassmorphism */
.aws-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.aws-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(184, 232, 3, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.aws-card:hover::before {
    opacity: 1;
}

.aws-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-xl);
    border-color: rgba(184, 232, 3, 0.4);
    background: rgba(255, 255, 255, 0.85);
}

/* Inputs - Modern Style */
.aws-input {
    background: var(--niccom-surface, #fff);
    border: 1px solid var(--niccom-border, #d8e2ee);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--niccom-text, #10233f);
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.aws-input::placeholder {
    color: #94a3b8;
}

.aws-input:focus {
    outline: none;
    border-color: var(--lime);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--niccom-accent, #16a6d9) 18%, transparent);
    background: var(--niccom-surface, #fff);
}

/* Utility */
.hidden { display: none !important; }

/* Custom Scrollbar for AWS feel */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: #d5dbdb;
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #aab7b8;
}

/* Modal Backdrop */
.aws-modal-backdrop {
    background-color: rgba(242, 243, 243, 0.9);
    backdrop-filter: blur(2px);
}

/* Typing Indicator Animation */
#typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px 20px;
}

#typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--party-purple);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

#typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

#typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Floating Action Button */
button[onclick*="chat.html"] {
    background: var(--niccom-gradient, linear-gradient(135deg, #012454, #16a6d9)) !important;
    box-shadow: 0 8px 25px rgba(1, 36, 84, 0.28);
    transition: all 0.3s ease;
}

button[onclick*="chat.html"]:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(1, 36, 84, 0.36);
}

/* Header Navigation */
header.niccom-chat-header {
    background: color-mix(in srgb, var(--niccom-surface, #fff) 88%, transparent) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--niccom-border, #d8e2ee);
}

/* Footer */
footer.niccom-footer {
    background: var(--niccom-primary-strong, #001a3d) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Pulse Animation for Icons */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.fas, .fa {
    animation: pulse 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    #beneficios .grid, #casos-uso .grid, #planes .grid {
        grid-template-columns: 1fr;
    }

    .message-text {
        max-width: 85%;
    }

    .aws-card {
        padding: 16px;
    }
}
