*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg-color: #f7f9fc;
    --content-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #7f8c8d;
    --border-color: #e0e0e0;
    --primary-color: #3498db;
    --card-shadow: 0 10px 25px rgba(0,0,0,0.05);
    --input-bg: #ffffff;
    --hover-bg: #f0f7fb;
    --error-color: #e74c3c;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --content-bg: #1e1e1e;
        --text-primary: #ecf0f1;
        --text-secondary: #bdc3c7;
        --border-color: #333333;
        --card-shadow: 0 10px 25px rgba(0,0,0,0.4);
        --input-bg: #2d2d2d;
        --hover-bg: #2a2a2a;
        --error-color: #ff4d4d;
    }
}

.form-group input.error, .form-control.error {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.2);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* Header & Logo */
.main-header {
    text-align: center;
    padding: 40px 0 20px 0;
    width: 100%;
}

#dynamic-logo {
    max-width: 250px;
    height: auto;
}

.main-wrapper {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    box-sizing: border-box;
}

/* Progress Bar */
.progress-wrapper {
    width: 100%;
    margin-bottom: 30px;
}

.progress-info {
    text-align: right;
    margin-bottom: 5px;
}

#progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.progress-container {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.4s ease;
}

/* Content Container */
.content-container {
    background: var(--content-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transition: background 0.3s, box-shadow 0.3s;
}

/* AI Box Styles */
.ai-box {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(155, 89, 182, 0.08));
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    margin-bottom: 30px;
    text-align: left;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ai-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.ai-content {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: italic;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

/* Typography */
h1 { color: #2c3e50; margin-bottom: 10px; }
h2 { color: #34495e; font-size: 1.5rem; margin-bottom: 25px; }
.subtitle { color: #7f8c8d; font-size: 1.1rem; margin-bottom: 30px; }

.section-tag {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    background: #eee;
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Colors */
.bg-strategy { background-color: #e3f2fd; color: #1565c0; }
.bg-execution { background-color: #e8f5e9; color: #2e7d32; }
.bg-people { background-color: #fff3e0; color: #ef6c00; }

/* Instructions List */
.instructions {
    text-align: left;
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.instructions li {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Buttons */
button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    margin-right: 10px;
}

.subquestions-container {
    text-align: left;
    margin-bottom: 20px;
}

.subquestion-item {
    margin-bottom: 10px;
    padding: 0;
    background: var(--bg-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.subquestion-item:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.subquestion-item.selected {
    background: #376585;
    border-color: #3498db;
}

/* Options Grid for Q&A */
.options-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    margin-bottom: 20px;
}

/* Binary buttons should be horizontal */
.options-grid.binary-options {
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.option-btn {
    padding: 15px 25px;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
}

.option-btn:hover, .option-btn.selected {
    border-color: #3498db;
    color: #3498db;
    background: #315366;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

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

.form-group input, .form-group select, .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
    box-sizing: border-box;
    font-family: inherit;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* International Phone Input Overrides */
.iti { 
    width: 100%; 
    display: block;
}

.iti__flag-container {
    z-index: 5;
}

/* Fix for intl-tel-input dropdown visibility */
.iti__country-list {
    background-color: var(--content-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    max-width: 300px;
}

.iti__country-name, .iti__dial-code {
    color: var(--text-primary) !important;
}

.iti__country.iti__highlight {
    background-color: var(--hover-bg) !important;
}

.iti--separate-dial-code .iti__selected-dial-code {
    color: var(--text-primary) !important;
    margin-left: 5px;
}

.form-group input:focus, .form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Charts */
.chart-box {
    margin-top: 20px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

.charts-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 20px;
    width: 100%;
}

.chart-box {
    margin-top: 20px;
    width: 100%;
    background: var(--content-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    box-sizing: border-box;
    transition: background 0.3s;
}

.chart-box canvas {
    width: 100% !important;
    height: 700px !important;
}

.score-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .score-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .score-summary {
        grid-template-columns: 1fr;
    }
}

.score-item {
    background: var(--content-bg);
    padding: 15px;
    border-radius: 10px;
    border-top: 4px solid var(--primary-color);
    box-shadow: var(--card-shadow);
    transition: background 0.3s;
}

.score-item .label {
    display: block;
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.user-info-display {
    background: var(--content-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    border-left: 5px solid var(--primary-color);
    text-align: left;
    transition: background 0.3s;
}

.user-info-item {
    display: flex;
    flex-direction: column;
}

.user-info-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #95a5a6;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.user-info-item .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.score-item .value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    border: none;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
    flex-wrap: wrap;
    padding-bottom: 50px;
}

/* Open Answers Styles */
.open-answers-container {
    text-align: left;
    margin-bottom: 40px;
}

.open-answers-container h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.open-qa-item {
    background: var(--content-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.open-q {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.open-a {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* New Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 40px; /* Increase horizontal gap to 40px */
    margin-bottom: 30px;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.full-width {
    grid-column: 1 / -1;
}

/* Instruction Box */
.instruction-box {
    background: var(--content-bg);
    padding: 30px;
    border-radius: 12px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: left;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.instruction-steps {
    text-align: left;
    max-width: 500px;
    margin: 0 auto 30px auto;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
    background: var(--hover-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.step-num {
    background: var(--primary-color);
    color: white;
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.disclaimer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

@media (prefers-color-scheme: dark) {
    .instruction-box {
        background: linear-gradient(135deg, #243b53 0%, #102a43 100%);
        color: #d9e2ec;
    }
}

/* Loader */
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

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

@media (max-width: 600px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .chart-box {
        padding: 10px;
    }
}

/* Privacy Checkbox Group */
.privacy-group {
    margin-top: 25px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: var(--hover-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: left;
}

.privacy-group.error {
    border-color: var(--error-color);
    background: rgba(231, 76, 60, 0.05);
    animation: shake 0.4s ease-in-out;
}

.privacy-group input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: 3px 0 0 0 !important;
    cursor: pointer;
    flex-shrink: 0;
}

.privacy-group label {
    font-size: 0.9rem;
    font-weight: 400 !important;
    cursor: pointer;
    line-height: 1.5;
    margin: 0 !important;
    color: var(--text-primary);
}

.privacy-group a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

.privacy-group a:hover {
    color: var(--text-primary);
}
