:root {
    --primary: #0087e7;
    --accent: #0042a6;
    --popup: #00a7ee;
    --text-main: #5f6368;
    --text-strong: #393c41;
    --background: #f2f4f8;
    --card-border: #49b7ff;
    --sidebar-collapsed-width: 76px;
    --sidebar-expanded-width: 270px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', 'Nunito', 'Montserrat', sans-serif;
    background: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
}

.promo-popup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.promo-popup.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.promo-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.promo-popup__card {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    background: var(--popup);
    border-radius: 36px;
    padding: 40px 44px 36px;
    color: #fff;
    box-shadow: 0 28px 80px rgba(0, 66, 166, 0.35);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.promo-popup__close {
    position: absolute;
    top: 16px;
    right: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-popup__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.promo-popup__header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.promo-popup__brand {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.promo-popup__logo {
    width: 150px;
    max-width: 100%;
}

.promo-popup__brand-tagline {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--accent);
}

.promo-popup__title {
    text-align: center;
    font-size: 26px;
    margin: 0;
    font-weight: 700;
}

.promo-popup__lead {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
}

.promo-popup__form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.promo-popup__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.promo-popup__error {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #ffd7d7;
    text-align: center;
}

.promo-popup__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-popup__field input {
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.12);
    padding: 14px 18px;
    font-family: inherit;
    font-size: 15px;
    color: #fff;
}

.promo-popup__field input::placeholder {
    color: rgba(255, 255, 255, 0.85);
}

.promo-popup__field input:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.22);
}

.promo-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    align-items: center;
}

.promo-popup__submit {
    border: none;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 18px 42px rgba(0, 66, 166, 0.35);
    width: 250px;
}

.promo-popup__submit:hover {
    background: #00388d;
}

.promo-popup__cancel {
    border: none;
    border-radius: 20px;
    background: #fff;
    color: var(--accent);
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 250px;
}

.promo-popup__cancel:hover {
    background: rgba(255, 255, 255, 0.85);
}

.promo-popup__confirmation {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.promo-popup__confirmation .promo-popup__submit {
    align-self: center;
}

.promo-popup__confirmation-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.promo-popup__confirmation-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.promo-popup__footnote {
    margin: 0;
    text-align: center;
    font-size: 12px;
    opacity: 0.9;
}

.promo-popup__card[data-state="submitted"] .promo-popup__form {
    display: none;
}

.promo-popup__card[data-state="submitted"] .promo-popup__confirmation {
    display: flex;
}

.sidebar-shell {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex: 0 0 auto;
    flex-shrink: 0;
    position: relative;
}

.sidebar {
    width: var(--sidebar-collapsed-width);
    background: var(--accent);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 24px 0;
    gap: 24px;
    transition: width 0.25s ease;
    color: #fff;
}

.sidebar--expanded {
    width: var(--sidebar-expanded-width);
}

.sidebar__toggle {
    border: none;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 64px;
    margin-top: 28px;
    margin-left: -12px;
    border-radius: 0 20px 20px 0;
    box-shadow: 6px 6px 18px rgba(0, 66, 166, 0.22);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar__toggle:hover {
    background: #003a94;
    transform: translateX(2px);
}

.sidebar__toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.sidebar__toggle-icon {
    width: 14px;
    height: 14px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
}

.sidebar--expanded + .sidebar__toggle .sidebar__toggle-icon {
    transform: rotate(225deg);
}

.sidebar__menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-inline: 12px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, padding 0.2s ease;
}

.sidebar__link:hover,
.sidebar__link:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.sidebar-icon {
    width: 36px;
    height: auto;
    display: block;
    flex-shrink: 0;
}

.sidebar-icon--brand {
    width: 36px;
    height: 36px;
    display: block;
    background-image: url("../img/cooperrita_logo.png");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 109px;
    filter: brightness(0) invert(1);
}

.sidebar__label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease, max-width 0.2s ease;
}

.sidebar--expanded .sidebar__link {
    justify-content: flex-start;
}

.sidebar--expanded .sidebar__label {
    opacity: 1;
    max-width: 180px;
}

.content {
    flex: 1;
    padding: 48px 56px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.brand-tag {
    position: absolute;
    top: 28px;
    right: 56px;
    display: inline-block;
    width: 185px;
    max-width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.brand-tag img {
    width: 100%;
    height: auto;
    display: block;
}

.hero {
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
}

.hero-graphic {
    width: 680px;
    max-width: 100%;
    height: auto;
    margin: 56px auto 48px;
    display: block;
}

.tagline {
    font-size: 24px;
    font-weight: normal;
    line-height: 1.5;
    margin: 0 0 36px;
}

.tagline strong {
    color: var(--text-strong);
}

.cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 36px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.cta-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
}

.quick-prompts {
    margin-top: 40px;
    display: flex;
    gap: 22px;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

.prompt {
    width: 200px;
    min-height: 88px;
    border: 2px solid var(--card-border);
    border-radius: 22px;
    background: #fff;
    color: var(--primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    cursor: pointer;
}

.prompt-library {
    margin-top: 32px;
    padding: 24px;
    border: 2px solid var(--card-border);
    border-radius: 24px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.prompt-library__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.prompt-library__title {
    margin: 0;
    font-size: 20px;
    color: var(--primary);
}

.prompt-library__close {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.prompt-library__group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prompt-library__section {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-strong);
}

.prompt-library__list {
    margin: 0;
}

.prompt-library__list.quick-prompts {
    margin-top: 0;
}

.chat-wrapper {
    flex: 1;
    max-width: 880px;
    margin: 40px auto 0;
    width: 100%;
}

.chat-panel {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 66, 166, 0.1);
    display: flex;
    flex-direction: column;
    height: min(720px, calc(100vh - 120px));
}

.chat-messages {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-message {
    max-width: 75%;
    padding: 18px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 16px;
}

.chat-message.bot {
    align-self: flex-start;
    background: rgba(0, 135, 231, 0.08);
    color: var(--text-strong);
}

.chat-message.bot.typing {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
}

.typing-indicator {
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
}

.typing-indicator__dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.2;
    animation: typing-bounce 1s infinite ease-in-out;
}

.typing-indicator__dot:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator__dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .typing-indicator__dot {
        animation: none;
        opacity: 0.6;
    }
}

.chat-message.user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
}

.chat-input {
    border-top: 1px solid rgba(0, 135, 231, 0.2);
    padding: 20px 24px;
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    border: none;
    background: rgba(0, 135, 231, 0.08);
    border-radius: 18px;
    padding: 16px 18px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text-strong);
    min-height: 56px;
}

.chat-input textarea:focus {
    outline: 2px solid var(--primary);
}

.chat-input button {
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    padding: 0 26px;
    height: 56px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.chat-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

@media (max-width: 1280px) {
    body {
        flex-direction: column;
    }

    .sidebar-shell {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .promo-popup {
        padding: 16px;
    }

    .promo-popup__card {
        padding: 28px 24px 24px;
    }

    .promo-popup__logo {
        width: 60px;
        padding: 10px;
    }

    .promo-popup__title {
        font-size: 22px;
    }

    .promo-popup__lead {
        font-size: 15px;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 16px;
        padding: 16px 20px;
    }

    .sidebar--expanded {
        width: 100%;
    }

    .sidebar__toggle {
        display: none;
    }

    .sidebar__menu {
        flex-direction: row;
        gap: 16px;
        padding: 0;
    }

    .sidebar__link {
        justify-content: flex-start;
        padding: 10px 14px;
    }

    .sidebar__label {
        opacity: 1;
        max-width: none;
    }

    .sidebar-icon {
        margin-top: 0;
    }

    .content {
        padding: 32px 24px;
    }

    .brand-tag {
        position: static;
        margin: 0 auto 24px;
    }

    .hero-graphic {
        margin-top: 24px;
    }

    .chat-wrapper {
        margin-top: 24px;
        max-width: none;
    }

    .chat-panel {
        border-radius: 18px;
        height: calc(100vh - 160px);
    }

    .chat-input {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-input button {
        width: 100%;
    }
}
