/* Помощник «Аврора». Цвета — из палитры сайта, акцент — бирюза логотипа Курортмакс. */
.aurora {
    --au-accent: #12b8c9;
    --au-accent-2: #1ee3b0;
    --au-ink: var(--ink, #18343d);
    --au-muted: var(--muted, #667b80);
    --au-sea: var(--sea, #0e5966);
    --au-sea-dark: var(--sea-dark, #073b47);
    --au-line: var(--line, #d9e4e2);
    position: fixed;
    right: 20px;
    bottom: 110px; /* повыше от края, чтобы кнопку было лучше видно */
    z-index: 90;
    font-family: inherit;
    color: var(--au-ink);
}

.aurora__launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px 6px 6px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(7, 59, 71, .22), 0 0 0 2px rgba(18, 184, 201, .35);
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
}
.aurora__launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(7, 59, 71, .28), 0 0 0 2px var(--au-accent); }
.aurora__launcher:focus-visible { outline: 3px solid var(--au-accent); outline-offset: 3px; }
.aurora__launcher-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--au-line);
    object-fit: contain;
    padding: 3px;
}
.aurora__launcher-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.aurora__launcher-text strong { font-size: 16px; color: var(--au-sea); white-space: nowrap; }
.aurora__launcher-text small { font-size: 12px; color: var(--au-muted); white-space: nowrap; }
.aurora--open .aurora__launcher { display: none; }
.aurora--open { bottom: 20px; } /* открытое окно — во всю высоту, как раньше */

.aurora__panel {
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100vw - 32px));
    height: min(600px, calc(100vh - 40px));
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(7, 59, 71, .28);
    overflow: hidden;
    animation: aurora-in .22s ease-out;
}
.aurora__panel[hidden] { display: none; }
@keyframes aurora-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.aurora__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    color: #fff;
    background: linear-gradient(120deg, var(--au-sea-dark), var(--au-sea) 60%, #0f7f8c);
}
.aurora__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
    padding: 3px;
    flex: none;
}
.aurora__title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.aurora__title strong { font-size: 17px; }
.aurora__title small { font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aurora__close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.aurora__close:hover { background: rgba(255, 255, 255, .26); }

.aurora__log {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f6faf9;
    overscroll-behavior: contain;
}
.aurora__msg {
    max-width: 86%;
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.aurora__msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--au-line); border-bottom-left-radius: 5px; }
.aurora__msg--user { align-self: flex-end; color: #fff; background: var(--au-sea); border-bottom-right-radius: 5px; }
.aurora__msg a { color: var(--au-sea); font-weight: 600; }
.aurora__msg--user a { color: #fff; }

.aurora__typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.aurora__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--au-accent); animation: aurora-dot 1s infinite ease-in-out; }
.aurora__typing i:nth-child(2) { animation-delay: .15s; }
.aurora__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aurora-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.aurora__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 10px; background: #f6faf9; }
.aurora__quick[hidden] { display: none; }
.aurora__quick button {
    padding: 7px 11px;
    border: 1px solid rgba(18, 184, 201, .45);
    border-radius: 999px;
    background: #fff;
    color: var(--au-sea);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.aurora__quick button:hover { background: rgba(18, 184, 201, .1); }

.aurora__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--au-line); }
.aurora__form[hidden] { display: none; }
.aurora__form textarea {
    flex: 1;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid var(--au-line);
    border-radius: 14px;
    font: inherit;
    font-size: 15px;
    resize: none;
    color: inherit;
}
.aurora__form textarea:focus { outline: none; border-color: var(--au-accent); box-shadow: 0 0 0 3px rgba(18, 184, 201, .18); }
.aurora__form button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--au-accent-2), var(--au-accent));
    cursor: pointer;
    flex: none;
}
.aurora__form.is-busy button { opacity: .5; pointer-events: none; }

.aurora__lead { display: grid; gap: 8px; padding: 12px; border-top: 1px solid var(--au-line); background: #fff; }
.aurora__lead[hidden] { display: none; }
.aurora__lead p { margin: 0; font-size: 13.5px; color: var(--au-muted); }
.aurora__lead input[type="text"], .aurora__lead input[type="tel"] {
    padding: 10px 12px;
    border: 1px solid var(--au-line);
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
}
.aurora__trap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.aurora__consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--au-muted); }
.aurora__lead-actions { display: flex; gap: 8px; }
.aurora__lead-send {
    flex: 1;
    padding: 11px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: var(--coral, #ef765d);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.aurora__lead-send:disabled { opacity: .6; }
.aurora__lead-cancel { padding: 11px 14px; border: 1px solid var(--au-line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; }

.aurora__foot { display: flex; flex-direction: column; gap: 4px; padding: 0 12px 10px; }
.aurora__foot span { font-size: 11px; color: var(--au-muted); text-align: center; }
.aurora__callback {
    padding: 9px;
    border: 1px dashed rgba(14, 89, 102, .35);
    border-radius: 12px;
    background: transparent;
    color: var(--au-sea);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.aurora__max {
    display: block;
    padding: 9px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2b7bff, #8a3ffc);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}
.aurora__max:hover { filter: brightness(1.08); color: #fff; }
.aurora__callback.is-highlighted { border-style: solid; color: #fff; background: var(--coral, #ef765d); border-color: transparent; }

@media (max-width: 600px) {
    .aurora { right: 12px; bottom: 84px; }
    .aurora__launcher { padding: 4px 14px 4px 4px; gap: 8px; }
    .aurora__launcher-avatar { width: 40px; height: 40px; }
    .aurora__launcher-text strong { font-size: 14px; }
    .aurora__launcher-text small { display: none; }
    .aurora--open { inset: 0; }
    .aurora--open .aurora__panel { width: 100%; height: 100%; max-width: none; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .aurora__panel, .aurora__typing i { animation: none; }
    .aurora__launcher { transition: none; }
}

/* Новое сообщение от Авроры, пока чат свёрнут (например, готов расчёт). */
.aurora__launcher.has-news { position: relative; animation: aurora-pulse 1.6s ease-in-out 3; }
.aurora__launcher.has-news::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 40px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--coral, #ef765d);
    box-shadow: 0 0 0 2px #fff;
}
@keyframes aurora-pulse { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }

/* Облачко-приглашение рядом с кнопкой Авроры. */
.aurora__teaser {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    width: 300px;
    padding: 14px 16px 12px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(7, 59, 71, .24), 0 0 0 1px rgba(18, 184, 201, .25);
    animation: aurora-in .35s ease-out;
}
.aurora__teaser[hidden] { display: none; }
.aurora__teaser::after {
    content: '';
    position: absolute;
    right: 34px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: 3px 3px 6px rgba(7, 59, 71, .08);
}
.aurora__teaser-text { margin: 0 18px 10px 0; font-size: 14px; line-height: 1.45; cursor: pointer; }
.aurora__teaser-text strong { font-size: 15px; color: var(--au-sea); }
.aurora__teaser-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #f1f6f5;
    color: var(--au-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.aurora__teaser-quick { display: flex; flex-direction: column; gap: 6px; }
.aurora__teaser-quick button {
    padding: 8px 12px;
    border: 1px solid rgba(18, 184, 201, .45);
    border-radius: 12px;
    background: #fff;
    color: var(--au-sea);
    font: inherit;
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
}
.aurora__teaser-quick button:hover { background: rgba(18, 184, 201, .1); }
.aurora--open .aurora__teaser { display: none; }

@media (max-width: 600px) {
    /* На телефоне — одна короткая строка без кнопок, чтобы не закрывать страницу. */
    .aurora__teaser { width: min(260px, calc(100vw - 24px)); bottom: calc(100% + 12px); right: 0; padding: 10px 30px 10px 12px; }
    .aurora__teaser::after { right: 24px; bottom: -6px; }
    .aurora__teaser-text { margin: 0; font-size: 13px; }
    .aurora__teaser-text strong { display: inline; font-size: 13px; }
    .aurora__teaser-quick, .aurora__teaser-more { display: none; }
}
