:root {
    --accent-color: #0ea5e9; /* sky-blue */
    --text-color: #1f2937; /* charcoal */
    --text-muted-color: #6b7280;
    --background-color: #f9fafb;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --star-outline: #9ca3af;
    --white: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background-image: url('https://offertabs.s3.amazonaws.com/offer/9xwzzv/site/media/69f1382e41dc61.20394346.jpg');
    background-size: cover;
    background-position: center;
}

.card {
    background-color: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -2px var(--shadow-color);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.content-section {
    padding: 2.5rem 2rem;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

h1, h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted-color);
    line-height: 1.5;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 0;
    border-radius: 50%;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.star-btn:hover {
    transform: scale(1.15);
}

.star-icon {
    width: 3rem;
    height: 3rem;
    color: var(--star-outline);
    transition: color 0.2s ease;
}

.star-btn.hovered .star-icon,
.star-btn.selected .star-icon {
    color: var(--accent-color);
}


.form-field {
    width: 100%;
}

#comment-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#comment-input::placeholder {
    color: var(--text-muted-color);
}

#comment-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

#sticky-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.cta-button {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.2), 0 4px 6px -2px rgba(14, 165, 233, 0.1);
}

.cta-button:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.7;
}

.cta-button svg {
    width: 24px;
    height: 24px;
}

/* Results */
.results-summary {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.bar-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}
.bar-label {
    color: var(--text-muted-color);
    white-space: nowrap;
}
.bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background-color: #9ca3af;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}
.bar-fill.max {
    background-color: var(--accent-color);
}
.bar-stats {
    color: var(--text-color);
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.average-rating {
    text-align: center;
}
.average-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.total-responses {
    color: var(--text-muted-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

#status-container {
    padding: 0 2rem;
}
.error-message, .status-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    text-align: center;
}
.error-message {
    background-color: #fee2e2;
    color: #b91c1c;
}
.status-message {
    background-color: #e0f2fe;
    color: #0c4a6e;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hidden {
    display: none !important;
}

#wbx-powered-by-slot {
    padding: 1rem;
    text-align: center;
}

@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: stretch;
    }
    .card {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }
    .content-section {
        padding: 2rem 1.5rem;
    }
    h1, h2 {
        font-size: 1.25rem;
    }
    .star-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}
