/* ═══════════════════════════════════════════════════════════════════
   FLOATING CONSULTATION PANEL
   ═══════════════════════════════════════════════════════════════════ */

.floating-form-panel {
    position: fixed;
    right: 0;
    top: calc(50% + 8px);
    transform: translateY(-50%) translateX(90%);
    width: 332px;
    max-height: min(450px, calc(100vh - 125px));
    background: #fff;
    border-radius: 24px 0 0 24px;
    border: 1px solid rgba(18, 53, 36, 0.08);
    box-shadow: -14px 18px 52px rgba(18, 53, 36, 0.14);
    z-index: 9999;
    overflow: visible;
    transition: transform 0.4s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
}

/* Open state */
.floating-form-panel.is-open {
    transform: translateY(-50%) translateX(0);
}

.floating-form-panel.is-open:hover {
    box-shadow: -16px 22px 58px rgba(18, 53, 36, 0.18);
}

.floating-form-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(100%);
}

/* Toggle Button (chevron, visible when collapsed) */
.floating-form-toggle {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #2EBB79;
    border: none;
    width: 32px;
    height: 96px;
    border-radius: 16px 0 0 16px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -8px 10px 22px rgba(134, 169, 70, 0.28);
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
    z-index: 1002;
}

.floating-form-toggle:hover {
    background: #123524;
    box-shadow: -8px 10px 26px rgba(18, 53, 36, 0.28);
}

.floating-form-toggle i {
    transition: transform 0.3s ease;
}

.floating-form-panel.is-open .floating-form-toggle i {
    transform: rotateY(180deg);
}

/* Close Button */
.floating-form-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f3f7ef;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #123524;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
    z-index: 1001;
}

.floating-form-close:hover {
    background: #2EBB79;
    color: #fff;
}

/* Form Wrapper */
.floating-form-wrapper {
    padding: 16px 15px 12px;
    overflow: hidden;
    max-height: min(450px, calc(100vh - 125px));
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.floating-form-header {
    margin-bottom: 8px;
}

.floating-form-title {
    font-size: 15px;
    font-weight: 800;
    color: #123524;
    margin: 0;
    letter-spacing: -0.5px;
}

.floating-form-subtitle {
    font-size: 10px;
    color: #6b7280;
    margin: 0;
    line-height: 1.25;
}

/* Form */
.floating-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Form Group */
.floating-form-group {
    margin-bottom: 10px;
    animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Labels */
.floating-form-label {
    display: none;
}

.floating-form-label .text-danger {
    color: #dc3545;
}

/* Input Wrapper */
.floating-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.floating-input-wrap i {
    position: absolute;
    left: 12px;
    color: #2EBB79;
    font-size: 13px;
    z-index: 2;
    pointer-events: none;
}

/* Input & Textarea */
.floating-form-input,
.floating-form-textarea {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1.5px solid #cfd6ce;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.4;
    color: #1f2937;
    background: #fdfdfb;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.2s;
}

.floating-form-input {
    min-height: 46px;
}

.floating-form-input::placeholder,
.floating-form-textarea::placeholder {
    color: #000;
    font-size: 15px;
    opacity: 1;
}

.floating-form-input::-webkit-input-placeholder,
.floating-form-textarea::-webkit-input-placeholder {
    color: #000;
    font-size: 15px;
    opacity: 1;
}

.floating-form-input::-moz-placeholder,
.floating-form-textarea::-moz-placeholder {
    color: #000;
    font-size: 15px;
    opacity: 1;
}

.floating-form-input:-ms-input-placeholder,
.floating-form-textarea:-ms-input-placeholder {
    color: #000;
    font-size: 15px;
}

.floating-form-input:focus,
.floating-form-textarea:focus {
    outline: none;
    border-color: #2EBB79;
    box-shadow: 0 0 0 3px rgba(134, 169, 70, 0.15);
    background: #fafffe;
}

.floating-form-textarea {
    padding: 10px 12px;
    resize: none;
    min-height: 56px;
    max-height: 56px;
    overflow: hidden;
}

.floating-form-textarea::-webkit-scrollbar {
    display: none;
}

/* Submit Button */
.floating-form-submit {
    width: 100%;
    padding: 11px 14px;
    background: #2EBB79;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    margin-top: 2px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.floating-form-submit:hover {
    background: #123524;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(18, 53, 36, 0.25);
}

.floating-form-submit:active {
    transform: translateY(0);
}

/* Security Note */
.floating-form-security {
    display: none;
}

.floating-form-security i {
    font-size: 12px;
    margin-right: 4px;
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE DESIGN
   ───────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .floating-form-panel {
        top: calc(50% + 4px);
        width: 310px;
        max-height: min(430px, calc(100vh - 118px));
    }

    .floating-form-wrapper {
        max-height: min(430px, calc(100vh - 118px));
        padding: 15px 14px 10px;
    }

    .floating-form-title {
        font-size: 16px;
    }

    .floating-form-toggle {
        width: 30px;
        height: 90px;
    }
}

@media (max-width: 768px) {
    .floating-form-panel {
        width: min(320px, calc(100vw - 12px));
        right: 0;
        left: auto;
        top: 50%;
        bottom: auto;
        border-radius: 20px 0 0 20px;
        max-height: min(440px, calc(100vh - 104px));
        /* fully hidden — only the toggle arrow sticks out */
        transform: translateY(-50%) translateX(100%);
    }

    .floating-form-panel.is-open {
        transform: translateY(-50%) translateX(0);
    }

    .floating-form-panel.hidden {
        display: none;
    }

    .floating-form-toggle {
        position: absolute;
        right: 100%;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        width: 32px;
        height: 96px;
        border-radius: 16px 0 0 16px;
    }

    .floating-form-wrapper {
        padding: 14px 12px 10px;
        max-height: min(440px, calc(100vh - 104px));
        overflow-y: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .floating-form-wrapper::-webkit-scrollbar {
        display: none;
    }

    .floating-form-close {
        top: 12px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .floating-form-panel {
        width: min(300px, calc(100vw - 6px));
        max-height: min(420px, calc(100vh - 94px));
    }

    .floating-form-wrapper {
        padding: 12px 10px 10px;
        max-height: min(420px, calc(100vh - 94px));
    }

    .floating-form-title {
        font-size: 14px;
    }

    .floating-form-subtitle {
        font-size: 11px;
    }

    .floating-form-input,
    .floating-form-textarea {
        font-size: 15px;
        padding: 7px 9px 7px 30px;
    }

    .floating-form-input::placeholder,
    .floating-form-textarea::placeholder,
    .floating-form-input::-webkit-input-placeholder,
    .floating-form-textarea::-webkit-input-placeholder,
    .floating-form-input::-moz-placeholder,
    .floating-form-textarea::-moz-placeholder,
    .floating-form-input:-ms-input-placeholder,
    .floating-form-textarea:-ms-input-placeholder {
        font-size: 15px;
    }

    .floating-form-group {
        margin-bottom: 8px;
    }

    .floating-form-submit {
        padding: 8px 12px;
        font-size: 10px;
    }
}
