/* General Setup */
:root {
    --primary-color: #282b3d;
    --accent-color: #e9511d;
    --text-color: #f0f0f0;
    --background-color: #1a1c2a;
    --card-background: #282b3d;
    --border-color: #4a4e69;
    --success-color: #4caf50;
    --warning-color: #ffc107;
    --danger-color: #f44336;
    --accent-color-rgb: 233, 81, 29;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

#root {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.logo {
    width: 195px;
    height: 43px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

header h1 {
    font-size: 1.5rem;
    color: var(--accent-color);
    text-align: right;
}

/* Progress Bar */
.progress-container {
    height: 24px; /* Increased height for visibility */
    background-color: var(--primary-color);
    border-radius: 12px;
    margin-bottom: 2rem;
    position: relative; /* For absolute positioning of text */
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    transition: width 0.5s ease-in-out;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap; /* Prevent wrapping */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6); /* Improve readability */
    pointer-events: none; /* Make text non-interactive */
}

/* Main Content & Cards */
main {
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Main content transitions */
.fade-in {
    animation: fadeInAnimation 0.5s ease-in-out forwards;
}

@keyframes fadeInAnimation {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    font-weight: 500;
}

p {
    margin-bottom: 1rem;
}

/* Buttons */
.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
}


.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #d84a1a;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--border-color);
}


/* Question Section */
.question-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.question-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.question-text {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.rating-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rating-btn {
    flex-grow: 1;
    background-color: #3a3e52;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.rating-btn.selected {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Results Screen */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.result-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    min-height: 40px; /* Ensure cards have similar height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.traffic-light {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    border: 2px solid var(--text-color);
}

.score {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-color);
}

.feedback {
    font-style: italic;
    margin-top: 0.5rem;
}

/* Lead Form Redesign */
.lead-form-container {
    padding: 2.5rem;
    margin: 3rem auto;
    background-color: #2c2f42;
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.2);
    text-align: left;
    max-width: 550px;
}

.lead-form-container h3 {
    color: var(--accent-color);
    font-size: 1.4rem;
    margin-bottom: 2rem;
    font-weight: 500;
    text-align: center;
}

.lead-form-container form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.form-group-checkbox input[type="checkbox"] {
    margin-top: 5px; /* Align with first line of text */
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.form-group-checkbox label {
    font-size: 0.9rem;
    color: #c0c0c0;
    line-height: 1.5;
}


.form-group label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #c0c0c0;
    font-weight: 500;
}

.lead-form-container input {
    width: 100%;
    padding: 1rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    border-radius: 8px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lead-form-container input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(var(--accent-color-rgb), 0.5);
}

.lead-form-container input::placeholder {
    color: #888888;
}

.lead-form-container button {
    margin-top: 1rem;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.lead-form-container input.input-error {
    border-color: var(--danger-color);
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.5);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.35rem;
    padding-left: 0.2rem;
}

.hs-cta-container {
    margin: 2.5rem auto;
    display: flex;
    justify-content: center;
}

.ai-report {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.ai-report h3 {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}
.ai-report h4 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
}
.ai-report h5 {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}
.ai-report ul {
    list-style-position: inside;
    padding-left: 0.5rem;
    margin-bottom: 1rem;
}
.ai-report li {
    margin-bottom: 0.5rem;
    list-style-type: '→  ';
    padding-left: 0.5rem;
}

.ai-report br {
    display: block;
    content: "";
    margin-top: 0.5rem;
}

.ai-report .blinking-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2rem; /* match line height */
    background-color: var(--accent-color);
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
    margin-left: 4px;
}

@keyframes blink {
    from, to { background-color: transparent }
    50% { background-color: var(--accent-color); }
}


/* Disclaimer */
.disclaimer {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--border-color);
    background-color: var(--background-color);
}

.disclaimer h3 {
    color: var(--warning-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.disclaimer p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.disclaimer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

.disclaimer a:hover {
    text-decoration: underline;
}

/* Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    border: 8px solid var(--border-color);
    border-top: 8px solid var(--accent-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

.spinner-text {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--text-color);
}

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

/* Responsive */
@media (max-width: 768px) {
    #root {
        padding: 1rem;
    }
    header {
        flex-direction: column;
        gap: 1rem;
    }
    .results-grid {
        grid-template-columns: 1fr;
    }
    .button-container {
        flex-direction: column;
        gap: 1rem;
    }
}