.bgi-tool-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 20px;
    overflow: visible;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* DYNAMIC BACKGROUND */
.bgi-tool-container::before {
    content: "";
    position: absolute;
    width: 110%;
    max-width: 900px;
    height: 70%;
    min-height: 300px;
    background-image: var(--bg-image);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    border-radius: 32px;
    z-index: 1;
    pointer-events: none;
}

.bgi-form-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 700px;
    background-color: #fff;
    background-image: var(--form-bg-image);
    background-size: cover;
    background-position: center;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.06);
    text-align: center;
    overflow: hidden;
}

.bgi-form-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #222222;
    text-align: left;
    line-height: 100%;
    letter-spacing: 0;
}

.bgi-form-desc {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    text-align: left;
}

.bgi-tool-form {
    text-align: left;
}

.bgi-field-group {
    margin-bottom: 10px;
}

.bgi-field-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 15px;
    line-height: 100%;
    letter-spacing: 0;
    color: #374151;
    text-align: left;
}

.bgi-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #ffffff;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    font-size: 11px;
    font-style: normal;
    font-weight: 400;
    cursor: help;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.bgi-info-icon:hover {
    color: #6b7280;
    border-color: #d1d5db;
    background: #f9fafb;
}

.bgi-field-group .required {
    color: #ff4d4d;
}

.bgi-field-group input[type="text"],
.bgi-field-group input[type="email"],
.bgi-field-group textarea,
.bgi-field-group select {
    width: 100%;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Custom Dropdown Arrow */
.bgi-field-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%23f57c00' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    
    background-repeat: no-repeat;
    background-position: right 12px center;

    background-size: 12px;   /* 🔥 increase this (try 24px / 26px / 30px) */

    padding-right: 50px;     /* adjust so text doesn't overlap */
}

.bgi-field-group input:focus,
.bgi-field-group select:focus,
.bgi-field-group textarea:focus {
    border-color: #f57c00;
    box-shadow: 0 0 0 2px rgba(245, 124, 0, 0.15);
    background-color: #fff;
}

.bgi-tone-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.bgi-pill {
    cursor: pointer;
    position: relative;
    margin: 0;
    display: block;
}

.bgi-pill:last-child {
    margin-bottom: 5px;
}

.bgi-pill input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bgi-pill-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
    background: #fff;
    height: 46px;
    box-sizing: border-box;
}

.bgi-pill input:checked + .bgi-pill-label {
    background: #fff3e0;
    color: #f57c00;
    border-color: #f57c00;
}

/* Custom Checkbox Styling */
.bgi-field-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    vertical-align: middle;
    background: #fff;
}

.bgi-field-group input[type="checkbox"]:checked {
    background-color: #f57c00;
    border-color: #f57c00;
}

.bgi-field-group input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.bgi-form-row {
    display: flex;
    gap: 20px;
}

.bgi-form-row .bgi-field-group {
    flex: 1;
}

.bgi-gen-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f57c00, #ff9f43);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    text-align: center;
}

.bgi-gen-btn:hover {
    background: linear-gradient(135deg, #e66a00, #f57c00);
    transform: translateY(-1px);
}

.bgi-gen-btn:active {
    transform: translateY(0);
}

.bgi-gen-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Results Styling */
.bgi-results-container {
    text-align: left;
}

.bgi-results-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 24px;
}

.bgi-back-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding: 0;
    transition: color 0.2s ease;
}

.bgi-back-btn:hover {
    color: #f57c00;
}

.bgi-output-section {
    margin-bottom: 30px;
}

.bgi-output-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.bgi-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.bgi-result-item {
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    color: #333;
    font-weight: 500;
    position: relative;
}

.bgi-result-item:hover {
    border-color: #f57c00;
    background-color: #fffaf5;
}

.bgi-result-item.active {
    border-color: #f57c00;
    background: #fff;
    box-shadow: 0 0 0 2px #f57c00;
}

.bgi-char-count {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.bgi-result-item.over-limit {
    border-color: #ff4d4d;
}

.bgi-result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.bgi-res-action-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bgi-res-action-btn:hover {
    border-color: #f57c00;
    color: #f57c00;
    background-color: #fffaf5;
}

/* Outline Specific Styling */
.bgi-outline-full-result {
    padding: 20px;
    background: #fcfcfc;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    color: #333;
    line-height: 1.6;
}

.bgi-outline-section {
    margin-bottom: 24px;
}

.bgi-outline-item {
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 3px solid #f57c00;
}

.bgi-outline-summary {
    font-size: 13px;
    color: #777;
    font-style: italic;
}

/* ERROR VIEW (IN-CARD) */
.bgi-error-view {
    display: none;
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    box-sizing: border-box;
}

.bgi-error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.bgi-error-icon {
    width: 80px;
    height: 80px;
    background: #FFF3E0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.bgi-error-icon svg {
    stroke: #f57c00;
    fill: none;
    width: 36px;
    height: 36px;
}

.bgi-error-msg {
    font-size: 16px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 32px;
    font-weight: 400;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.bgi-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.bgi-retry-btn {
    background: #f57c00;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.bgi-retry-btn:hover {
    background: #e67e00;
}

.bgi-back-btn-err {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    border-radius: 6px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bgi-back-btn-err:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.bgi-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #f57c00;
    border-radius: 50%;
    animation: bgi-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes bgi-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bgi-loader-content p {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.bgi-loader-content small {
    color: #666;
}

@media (max-width: 768px) {
    .bgi-form-card {
        padding: 24px;
    }

    .bgi-tool-container::before {
        width: 120%;
        height: 60%;
    }

    .bgi-form-row {
        flex-direction: column;
        gap: 0px;
    }

    .bgi-form-row .bgi-field-group {
        width: 100%;
        margin-bottom: 10px;
    }

    .bgi-tone-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0;
        scrollbar-width: none; /* Firefox */
    }

    .bgi-tone-pills::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

}

/* CTA Banner Styling */
.bgi-cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-image: url('../image/CTA bg img.webp');
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    padding: 16px 20px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #f1ede4;
    gap: 15px;
}

.bgi-cta-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bgi-cta-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.bgi-cta-text {
    display: flex;
    flex-direction: column;
}

.bgi-cta-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0;
    line-height: 1.2;
}

.bgi-cta-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.bgi-cta-button {
    background: #f57c00;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
    display: inline-block;
}

.bgi-cta-button:hover {
    background: #e66a00;
}

.bgi-cta-footer-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.bgi-cta-tick {
    width: 16px;
    height: 16px;
    background: #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bgi-cta-tick svg {
    width: 10px;
    height: 10px;
    stroke: #fff;
}

.bgi-cta-footer {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 100%;
    letter-spacing: 0;
    text-align: center;
    color: rgba(102, 102, 102, 0.6);
}

.bgi-result-actions {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
}

@media (max-width: 768px) {
    .bgi-cta-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .bgi-cta-content {
        flex-direction: column;
        text-align: center;
    }
    .bgi-cta-button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .bgi-cta-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .bgi-cta-content {
        flex-direction: column;
        text-align: center;
    }
    .bgi-cta-button {
        width: 100%;
        text-align: center;
    }
}


