/* =========================
   1) Variables
========================= */
:root {
    --chat-bg: #0b1220;
    --bg: #f5f5f5;
    --text: #333;
    --card: #fff;

    --primary: #3498db;
    --primary-dark: #2980b9;

    --info-bg: #f0f8ff;
    --info-accent: #007BFF;

    --border: #ddd;
    --muted: #6f6f6f;

    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 10px;

    --shadow-lg: 0 4px 20px rgba(0, 0, 0, .1);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, .1);
}

/* =========================
   2) Reset / Base
========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

.w-100 {
    width: 100%;
}

body {
    font-family: 'Garet', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    position: relative;
}

/* Base elements */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--text);
}

/* =========================
   6) Overlay + Spinner
========================= */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.overlay__content {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.overlay {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(47, 47, 47, 0.33);
    z-index: 99999;
    display: block;
}

.spinner {
    width: 100px;
    height: 100px;
    border: 10px solid #f3f3f3;
    border-top: 10px solid var(--primary);
    border-radius: 50%;

    position: absolute;
    top: 40%;
    left: 46%;

    animation: spin 1s linear infinite;
}

.overlay__text {
    position: absolute;
    top: 58%;
    left: 49.5%;
    width: 80%;
    text-align: center;

    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.6px;

    color: #ffffff;

    /* Black outline */
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,

        /* soft glow for readability */
        0 2px 6px rgba(0, 0, 0, 0.5);

    transform: translate(-50%, -50%);
}

.overlay__text::after {
    content: '';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0% {
        content: '\00a0\00a0\00a0';
    }

    25% {
        content: '.\00a0\00a0';
    }

    50% {
        content: '..\00a0';
    }

    75% {
        content: '...';
    }

    100% {
        content: '\00a0\00a0\00a0';
    }
}

/* =========================
   7) Collapsible Sections
========================= */
.section-button {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f4f4f4;
    border: 1px solid var(--border);

    opacity: 1;
    visibility: visible;

    transition: opacity .3s ease-in-out, visibility .3s ease-in-out;

    box-sizing: border-box;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 15px;

    cursor: pointer;

    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.section-button-title {
    display: flex;
    flex-direction: row;
}

.section-button-title .number {
    margin-right: 10px;
}

.arrow-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    cursor: pointer;
}

.arrow-container::after {
    content: '▾';
    font-size: 1.4rem;
    transition: transform .3s ease;
}

.arrow-container.active::after {
    transform: rotate(-180deg);
}

.collapsabble-container {
    border: 0;
    background-color: #f9f9f9;
    height: 0;
    overflow: hidden;
    width: 100%;
    border: 1px solid #ddd;

    grid-template-columns: 1fr 1fr;
}

.collapsabble-container input {
    width: 100%;
    padding: .5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
}

.inner-collapsabble-container {
    border: 0;
    background-color: #f9f9f9;
    height: 0;
    overflow: hidden;
    width: 100%;
    border: 1px solid #ddd;

    grid-template-columns: 1fr 1fr;
}

.container-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.input-title {
    font-size: 1.2rem;
    font-weight: 400;
}

.multi-container-child {
    margin-top: 15px;
    background-color: #ececec;
    border-radius: var(--radius-sm);
    padding: 15px;

    position: relative;
}

.multi-container-child .fence-delete-button {
    background-color: rgb(255, 138, 138);
    padding: 5px;
    position: absolute;
    color: #fff;

    border-radius: var(--radius-sm);

    top: 5px;
    right: 5px;

    transition: all .5s ease-in-out;
}

.multi-container-child .fence-delete-button:hover {
    background-color: rgb(255, 72, 72);
}

.multi-container {
    display: flex;
    flex-direction: column;
}

.multi-container-title {
    font-weight: bold;
}

.multi-container-footer {
    margin-top: 10px;
    width: 100%;
}

.multi-container-footer button {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;

    transition: all .5s ease-in-out;
}

.multi-container-footer button:hover {
    background-color: #ee780e;
    color: #fff;
}

.card {
    width: 100%;
    padding: 5px 20px;
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    justify-content: center;
    box-sizing: border-box;
    font-weight: 600;

    transition: all .4s ease-in-out;

    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.card:hover {
    border: 3px solid #ee780e;
    border-radius: 20px;
}

.card label {
    text-align: center;
    font-weight: 600;
}

.card.active {
    border: 3px solid #ee780e;
}

.card img {
    max-width: 50%;
    max-height: 100px;
    margin: auto;
}

.button {
    align-items: center;
    gap: 8px;
    /* space between icon and text */
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #000000;
}

.button.active {
    border: 1px solid black;
}

.button:hover {
    background-color: #6c6c6c;
}

.chat-inner-button {
    align-items: center;
    gap: 8px;
    /* space between icon and text */
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #000;
    text-align: center;
}

/* Download button style */
.download-btn {
    background-color: #28a745;
    /* green */
}

.download-btn:hover {
    background-color: #218838;
}

/* Upload button style */
.upload-btn {
    background-color: #007bff;
    /* blue */
}

.upload-btn:hover {
    background-color: #0069d9;
}

/* Optional: icon size */
.button i {
    font-size: 18px;
}





.hn-form-container {
    width: 100%;
    box-sizing: border-box;
    margin: 40px auto;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.back-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    flex-direction: row;
    padding: 10px 20px;
    border-radius: 10px;
    background-color: #007BFF;
    color: white;
    cursor: pointer;
    border: 0;
}

.back-btn:hover {
    background-color: #0069d9;
    transition: all .4s ease-in-out;
}

.hn-form-row {
    display: flex;
    gap: 10px;
}

.hn-form-group {
    margin-bottom: 15px;
    width: 100%;
}

.hn-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.hn-input,
.hn-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.hn-checkbox-label {
    display: flex;
    align-items: center;
    /* key for same-row alignment */
    gap: 10px;
    cursor: pointer;
}

.hn-checkbox-label input {
    width: auto;
    margin-top: 3px;
}

.hn-required a {
    color: #007BFF;
    text-decoration: none;
}

.hn-submit-btn {
    width: 100%;
    padding: 10px;
    background: #007BFF;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.hn-form-group label:has(+ input[required])::after,
.hn-form-group label:has(+ select[required])::after,
.hn-form-group label:has(+ textarea[required])::after {
    content: " *";
    color: red;
}

.hn-submit-btn:hover {
    background: #0056b3;
}

.hn-checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.hn-required {
    line-height: 1.4;
}

.hn-select-wrapper {
    position: relative;
}

.hn-select-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.hn-select-overlay.hn-active {
    opacity: 1;
    pointer-events: all;
}

.hn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-top: 2px solid #007BFF;
    border-radius: 50%;
    animation: hn-spin 0.7s linear infinite;
}

@keyframes hn-spin {
    to {
        transform: rotate(360deg);
    }
}





.gate-img {
    width: 1000px;
}

.color-card {
    width: 100%;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: bolder;
    display: flex;
    justify-content: center;
    cursor: pointer;
}

.custom-select {
    width: 100%;
    position: relative;
    font-family: Arial, sans-serif;
}

.custom-select select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* arrow */
.custom-select::after {
    content: "▾";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #555;
    pointer-events: none;
}

.section {
    margin-bottom: 10px;
}

.section.open .section-button {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.section.open .collapsabble-container {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 10px;
    height: 100%;
}

.inner-collapsabble-container.open {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 10px;
    height: 100%;
}

/* =========================
   7) SWITCH
========================= */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.switch {
    display: inline-block;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch__track {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 28px;
    border-radius: 999px;
    background: #cfcfcf;
    transition: .2s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}

.switch__track::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font: 700 11px/1 Arial, sans-serif;
    color: rgba(0, 0, 0, .6);
    transition: .2s ease;
}

.switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    transition: transform .2s ease;
}

.switch input:checked+.switch__track {
    background: #3498db;
}

.switch input:checked+.switch__track::before {
    content: "ON";
    left: 38px;
    color: rgba(255, 255, 255, .9);
}

.switch input:checked+.switch__track::after {
    transform: translateX(36px);
}

/* =========================
   9) Modal
========================= */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, .5);
    overflow: auto;
    padding-top: 60px;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    padding-top: 40px;

    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    text-align: center;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 0;
    right: 10px;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.modal-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.modal-icon {
    font-size: 3rem;
}

.modal-description {
    font-size: 1rem;
    margin-top: 15px;
    color: var(--text);
}

/* =========================
   3) Utilities
========================= */
.row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    overflow-x: auto;

    gap: 10px;
}

.column {
    flex-direction: column;
}

.two-by-two {
    display: grid;
    grid-template-columns: 6fr 6fr;
    box-sizing: border-box;
    gap: 10px;
}

.two-in-row {
    display: grid;
    grid-template-columns: 6fr 6fr;
    box-sizing: border-box;
    gap: 10px;
}

.three-in-row {
    display: grid;
    grid-template-columns: 6fr 6fr 6fr;
    box-sizing: border-box;
    gap: 10px;
    overflow-x: auto;
}

.whole-row {
    grid-column: span 2;
}

.bold {
    font-weight: bold;
}

.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0;
}

/* =========================
   4) Info Box
========================= */
.info-box {
    display: flex;
    align-items: flex-start;
    background-color: var(--info-bg);
    border-left: 4px solid var(--info-accent);
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;

    font-family: Arial, sans-serif;
    font-size: 14px;
    color: var(--muted);
}

.info-icon {
    font-size: 20px;
    margin-right: 12px;
    line-height: 1.2;
}

.info-content strong {
    display: block;
    margin-bottom: 4px;
}

/* =========================
   5) Main Layout
========================= */
#configurator-root {
    display: flex;
    flex-direction: row;
    width: 90%;
    height: 80vh;

    padding-bottom: 5px;

    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.config-visual {
    flex: 2;
    background: #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gateCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.config-panel {
    padding: 20px;
    max-width: 40%;
    overflow-y: auto;
    position: relative;
    background: #ddd;
}

.config-panel h2 {
    margin-bottom: 1rem;
}

.cs-button {
    background: linear-gradient(45deg,
            #a0e1ff,
            /* Light Sky Blue (brighter) */
            #98f5e1,
            /* Bright Mint */
            #f2a7c7,
            /* Vivid Pink */
            #bfa9ff,
            /* Lavender (more saturated) */
            #ffef98,
            /* Light Yellow */
            #fff2b2
            /* Pale Gold */
        );
    background-size: 400% 400%;
    animation: gradientBackground 10s ease infinite;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    margin-top: 20px;
}

@keyframes gradientBackground {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* =========================
   15) Responsive
========================= */
@media (max-width: 800px) {
    body {
        max-height: 85vh;
    }

    html,
    body {
        overflow: hidden;
        overscroll-behavior: none;
        max-height: 100%;
    }

    .step {
        font-size: .6rem;
        padding: 10px;
    }

    .step-line {
        width: 5px;
    }

    .step-container {
        margin: 5px 0;
    }

    .texture-container img {
        width: 40%;
        height: 80px;
    }

    .info-btn {
        font-size: 1.5rem !important;
        top: 10px;
        right: 10px;
    }

    .simple-icon {
        font-size: 3rem !important;
    }

    .texture-container label {
        font-size: .7rem;
    }

    .content label {
        font-size: .8rem;
    }

    .color-option,
    .selected-color {
        height: 60px !important;
    }

    h2 {
        font-size: 1.2rem;
    }

    .texture-container img {
        height: 60px !important;
    }

    #contactForm {
        padding-top: 10px;
    }

    .button {
        font-size: .8rem;
        padding: 5px;
    }

    #submitBtn,
    #nextButton {
        font-size: 1.2rem;
    }

    .next-button {
        width: 100% !important;
    }

    #configurator-root {
        flex-direction: column;
        height: 90%;
        width: 100%;
    }

    #backButton {
        font-size: .6rem;
    }

    .config-visual {
        height: 40vh;
    }

    #gateCanvas {
        height: 40vh;
    }

    .config-panel {
        border-left: none;
        border-top: 1px solid #e0e0e0;
        padding: 1rem;
        max-width: 100%;
    }

    .card {
        padding: 2px;
    }


    .order-image-container {
        min-width: 60px !important;
        width: 60px !important;
        height: 40px !important;
    }
}

.order-container {
    margin-top: 5px;
    border-radius: var(--radius-sm);
    border: 1px solid black;
    display: flex;
    flex-direction: row;

    gap: 10px;

    width: 90%;
    padding: 10px;

    overflow-x: auto;
    overflow-y: hidden;
}

.order-image-container {
    min-width: 120px;
    height: 80px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;

    position: relative;

    transition: all .1s ease-in-out;
}

.order-image-container .dimensions {
    position: absolute;
    left: 50%;
    bottom: 5px;
    font-weight: bold;
    font-size: .7rem;
    width: 100%;
    margin: 0 auto;
    text-align: center;

    transform: translateX(-50%);
}

.order-image-container img {
    width: 100%;
    height: 100%;
}

.order-image-container:hover {
    border: 3px solid black;
    cursor: grab;
}

.newFenceButtonInOrder {
    border-radius: 10px;
    min-width: 120px;
    transition: all .1s ease-in-out;
    border: 1px solid #ddd;
    font-size: 2rem;
}

.newFenceButtonInOrder:hover {
    border-radius: 10px;
    min-width: 120px;
    border: 3px solid black;
}


.placeholder {
    width: 100px;
    height: 100px;
    border: 2px dashed #999;
    background: rgba(0, 0, 0, 0.05);
}



/* Floating button */
.chat-button {
    position: fixed;
    bottom: 18px;
    right: 18px;
    width: 100px;
    height: 100px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 1001;
    color: white;
    font-size: 32px;
    user-select: none;

    background: linear-gradient(135deg, rgba(110, 168, 255, 1), rgba(124, 240, 197, 1));
    box-shadow: var(--shadow);
    transition: transform .18s ease, filter .18s ease;
}

.chat-button::before,
.chat-button::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: #4CAF50;
    opacity: 0;
}

/* Animate ONLY when chat-window does NOT have .show */
.chat-window:not(.show)~.chat-button::before,
.chat-window:not(.show)~.chat-button::after {
    opacity: 0.6;
    animation: pulseAnim 2s infinite;
}

.chat-window:not(.show)~.chat-button::after {
    animation-delay: 1s;
}

@keyframes pulseAnim {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    70% {
        transform: scale(1.6);
        opacity: 0;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.chat-input {
    width: 100%;
    padding: .5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
}

.chat-button:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.05);
}

.chat-button:active {
    transform: translateY(0) scale(0.98);
}

/* Chat window */
.chat-window {
    position: fixed;
    right: 22px;
    bottom: 102px;
    width: 440px;
    max-width: calc(100vw - 36px);
    height: 620px;
    max-height: calc(100vh - 140px);

    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1002;

    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(57, 49, 49, 0.838), rgba(62, 43, 43, 0.06));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    box-shadow: var(--shadow);
    transform: translateY(14px) scale(0.98);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
}

.chat-window.show {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Header */
.chat-header {
    padding: 12px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(90deg, rgba(110, 168, 255, 0.20), rgba(124, 240, 197, 0.12));
}

.chat-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #0b1220;
    font-weight: 800;
    background: linear-gradient(135deg, rgba(110, 168, 255, 1), rgba(124, 240, 197, 1));
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.chat-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-title strong {
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-title span {
    color: #ddd;
    font-size: 12px;
    line-height: 1.1;
}

/* Optional close button (if you add it) */
.chat-header .chat-close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .15s ease, background .15s ease;
}

.chat-header .chat-close:hover {
    background: rgba(255, 255, 255, 0.10);
    transform: scale(1.03);
}

/* Message area */
#chat-response {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.02));
}

#chat-response::-webkit-scrollbar {
    width: 10px;
}

#chat-response::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0);
    background-clip: padding-box;
}

/* Messages */
.chat-message {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: flex-end;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.ai {
    justify-content: flex-start;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-weight: 800;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid var(--border);
}

.chat-message.user .avatar {
    background: linear-gradient(135deg, rgba(110, 168, 255, 1), rgba(124, 240, 197, 1));
    border: none;
    color: #0b1220;
}

.message-bubble {
    width: 78%;
    padding: 10px 12px;
    border-radius: 16px;
    line-height: 1.35;
    font-size: 13.5px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.14);

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-bubble h3 {
    color: white;
}

.message-bubble button {
    border-radius: 5px;
    padding: 10px 20px;

    transition: all .2s ease-in-out;
}

.message-bubble button.not-selected {
    background-color: #b9b9b9;
    display: none;
}

.message-bubble button:not(.not-selected):not(.selected):hover {
    box-shadow: #64fdfa69 0 0 10px 5px;
}

.chat-message.ai .message-bubble {
    color: #fff;
    background: rgba(43, 43, 43, 0.812);
    border-top-left-radius: 10px;
}

.chat-message.user .message-bubble {
    color: #0b1220;
    background: linear-gradient(135deg, rgba(110, 168, 255, 1), rgba(124, 240, 197, 1));
    border: none;
    border-top-right-radius: 10px;
}

/* Markdown-ish */
.message-bubble a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.message-bubble img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 8px;
}

/* Typing indicator */
.typing {
    display: inline-flex;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    animation: dot 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
    animation-delay: .15s;
}

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

@keyframes dot {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: .55;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Input area */
#chat-form {
    padding: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

#chat-form input {
    flex: 1;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text);
    padding: 0 12px;
    outline: none;
    transition: border .15s ease, background .15s ease;
}

#chat-form input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

#chat-form input:focus {
    border-color: rgba(110, 168, 255, 0.6);
    background: rgba(0, 0, 0, 0.26);
}

#chat-form button {
    height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    color: #0b1220;
    background: linear-gradient(135deg, rgba(110, 168, 255, 1), rgba(124, 240, 197, 1));
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
    transition: transform .15s ease, filter .15s ease;
}

#chat-form button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

#chat-form button:active {
    transform: translateY(0);
}

.results-container {
    display: none;
    width: 90%;
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Config results */
.error-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;

    min-width: 320px;
    max-width: 420px;

    background: #dc2626;
    color: #ffffff;

    border-radius: 14px;
    padding: 14px 16px;

    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    font-family: Inter, sans-serif;

    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;

    transition: all 0.25s ease;
    z-index: 99999;
}

.error-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.error-toast-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.error-toast-icon {
    font-size: 18px;
    line-height: 1;
    margin-top: 1px;
}

.error-toast-message {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.error-toast-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.error-toast-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .error-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        min-width: unset;
    }
}

.config-result-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at top right, rgba(238, 127, 26, 0.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(238, 127, 26, 0.08), transparent 30%),
        linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    font-family: Inter, sans-serif;
}

.config-result-card {
    width: 100%;
    background: #ffffff;
    border-radius: 28px;
    padding: 42px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.config-result-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg,
            #EE7F1A 0%,
            #ff9c43 100%);
}

.config-result-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 36px;
}

.config-result-icon {
    width: 82px;
    height: 82px;
    min-width: 82px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg,
            #EE7F1A 0%,
            #ff9c43 100%);
    box-shadow:
        0 10px 25px rgba(238, 127, 26, 0.35);
}

.config-result-icon svg {
    width: 40px;
    height: 40px;
    color: #ffffff;
}

.config-result-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
}

.config-result-subtitle {
    margin: 14px 0 0;
    font-size: 16px;
    line-height: 1.7;
    color: #6b7280;
    max-width: 560px;
}

.config-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.config-result-box {
    background: linear-gradient(180deg,
            #ffffff 0%,
            #fafafa 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 22px;
    padding: 24px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.config-result-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: #EE7F1A;
}

.config-result-box:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.06);
}

.config-result-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 14px;
}

.config-result-value {
    font-size: 30px;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    word-break: break-word;
}

.config-result-support {
    margin-top: 10px;
    background:
        linear-gradient(135deg,
            rgba(238, 127, 26, 0.08) 0%,
            rgba(238, 127, 26, 0.03) 100%);
    border: 1px solid rgba(238, 127, 26, 0.16);
    border-radius: 24px;
    padding: 28px;
}

.config-result-support-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #EE7F1A;
    margin-bottom: 16px;
}

.config-result-support-text {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
}

.config-result-support-text strong {
    display: inline-block;
    margin-top: 4px;
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
}

.config-result-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    height: 56px;
    padding: 0 30px;
    border-radius: 16px;
    background:
        linear-gradient(135deg,
            #EE7F1A 0%,
            #ff9c43 100%);
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.25s ease;
    box-shadow:
        0 12px 25px rgba(238, 127, 26, 0.28);
}

.config-result-phone:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 35px rgba(238, 127, 26, 0.38);
}

.config-result-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 34px;
}

.config-result-button {
    border: none;
    outline: none;
    cursor: pointer;
    height: 58px;
    padding: 0 34px;
    border-radius: 18px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.25s ease;
}

.config-result-button.primary {
    background: #111827;
    color: #ffffff;
    box-shadow:
        0 10px 24px rgba(17, 24, 39, 0.18);
}

.config-result-button.primary:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow:
        0 16px 34px rgba(17, 24, 39, 0.24);
}

@media (max-width: 768px) {

    .config-result-screen {
        padding: 20px 14px;
    }

    .config-result-card {
        padding: 28px 22px;
        border-radius: 24px;
    }

    .config-result-header {
        flex-direction: column;
        gap: 18px;
    }

    .config-result-icon {
        width: 72px;
        height: 72px;
        min-width: 72px;
        border-radius: 20px;
    }

    .config-result-title {
        font-size: 28px;
    }

    .config-result-subtitle {
        font-size: 15px;
    }

    .config-result-value {
        font-size: 24px;
    }

    .config-result-support-text strong {
        font-size: 24px;
    }

    .config-result-actions {
        justify-content: stretch;
    }

    .config-result-button {
        width: 100%;
    }

    .config-result-phone {
        width: 100%;
    }
}

.check-email {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 16px;

    font-size: 15px;
    line-height: 1.6;
    color: #374151;

    background: linear-gradient(135deg,
            rgba(238, 127, 26, 0.08) 0%,
            rgba(238, 127, 26, 0.03) 100%);

    border: 1px solid rgba(238, 127, 26, 0.18);

    display: flex;
    align-items: flex-start;
    gap: 10px;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

/* Optional: make the emoji look consistent */
.check-email::before {
    content: "📩";
    font-size: 18px;
    line-height: 1;
    margin-top: 1px;
}

/* Optional emphasis for important parts */
.check-email strong {
    color: #111827;
    font-weight: 700;
}

#sec-services {
    padding: 14px;
    background: #f4f4f4;
    border-radius: var(--radius-sm);
}

/* Slight improvement on mobile */
@media (max-width: 768px) {
    .check-email {
        font-size: 14px;
        padding: 14px 14px;
    }
}

/* Mobile tweaks */
@media (max-width: 420px) {
    .chat-window {
        right: 10px;
        bottom: 78px;
        width: calc(100vw - 20px);
        height: min(560px, calc(100vh - 120px));
    }

    .chat-button {
        right: 12px;
        bottom: 12px;
    }
}