:root {
    /* Refined color scheme for minimal dark theme */
    --primary-color: #6b9bd1;
    --primary-hover: #5a8bc4;
    --error-color: #ff6b6b;
    --success-color: #51cf66;
    --text-color: #e4e4e7;
    --text-secondary: #a1a1aa;
    --bg-dark: #0f0f11;
    --bg-card: #1a1a1d;
    --border-color: #2a2a2e;
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --transition: all 0.2s ease;
    
    /* Section accent colors - more vibrant for better distinction */
    --accent-blue: #6b9bd1;
    --accent-purple: #a78bfa;
    --accent-teal: #5eead4;
    --accent-amber: #fbbf24;
    --accent-rose: #fb7185;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-dark);
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

/* Banner Image Styles - TOP VISIBLE FIX */
.header-banner {
    width: 100%;
    max-width: 1200px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
    object-fit: cover;
    object-position: top center;  /* ← FIX: Aligns image to show top portion */
    max-height: 250px;
}

fieldset {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 35px;
    background: var(--bg-card);
    box-shadow: var(--shadow-subtle);
}

legend {
    padding: 0 12px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.required {
    color: var(--error-color);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: var(--transition);
    background-color: var(--bg-dark);
    color: var(--text-color);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(107, 155, 209, 0.2);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    min-height: 20px;
}

/* CLEAN SECTION STYLING WITH COLOR-CODED BORDERS */
.section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-subtle);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    position: relative;
}

/* Color-coded left border for clear section distinction */
.section:nth-child(1) {
    border-left: 4px solid var(--accent-blue);
}

.section:nth-child(2) {
    border-left: 4px solid var(--accent-purple);
}

.section:nth-child(3) {
    border-left: 4px solid var(--accent-teal);
}

.section:nth-child(4) {
    border-left: 4px solid var(--accent-amber);
}

.section:nth-child(5) {
    border-left: 4px solid var(--accent-rose);
}

/* Color-coded section titles for enhanced identification */
.section:nth-child(1) .section-title {
    color: var(--accent-blue);
}

.section:nth-child(2) .section-title {
    color: var(--accent-purple);
}

.section:nth-child(3) .section-title {
    color: var(--accent-teal);
}

.section:nth-child(4) .section-title {
    color: var(--accent-amber);
}

.section:nth-child(5) .section-title {
    color: var(--accent-rose);
}

.section-title {
    margin: 0 0 25px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.4rem;
    font-weight: 600;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.image-container {
    position: relative;
    border-radius: var(--border-radius);
    overflow: visible;
    box-shadow: var(--shadow-subtle);
    width: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.image-container::before {
    content: '';
    display: block;
    padding-top: 100%;
}

.image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
}

/* Fifth image same size as others */
.image-container-fifth {
    grid-column: 1 / -1;
    width: 50%;
    margin: 0 auto;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-width: 95%;
    max-height: 95%;
    margin: auto;
}

/* Rating container positioned below image - not overlaying */
.rating-container {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    background: rgba(0, 0, 0, 0.9);
    padding: 12px 10px;
    display: flex;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(2px);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-top: auto;
}

/* ENHANCED RATING BUTTON STATES AND ANIMATIONS */
.rating-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 16px;
    padding: 0;
    flex-shrink: 0;
    position: relative;
}

/* Default hover state - subtle lift */
.rating-btn:hover:not(:disabled):not(.selected) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Section-specific selected states with matching colors */
.section:nth-child(1) .rating-btn.selected {
    background: var(--accent-blue);
    border-color: rgba(255, 255, 255, 0.9);
    color: white;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(107, 155, 209, 0.3),
                0 4px 12px rgba(107, 155, 209, 0.5);
    animation: selectPulse 0.3s ease-out;
}

.section:nth-child(2) .rating-btn.selected {
    background: var(--accent-purple);
    border-color: rgba(255, 255, 255, 0.9);
    color: white;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.3),
                0 4px 12px rgba(167, 139, 250, 0.5);
    animation: selectPulse 0.3s ease-out;
}

.section:nth-child(3) .rating-btn.selected {
    background: var(--accent-teal);
    border-color: rgba(255, 255, 255, 0.9);
    color: white;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.3),
                0 4px 12px rgba(94, 234, 212, 0.5);
    animation: selectPulse 0.3s ease-out;
}

.section:nth-child(4) .rating-btn.selected {
    background: var(--accent-amber);
    border-color: rgba(255, 255, 255, 0.9);
    color: white;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3),
                0 4px 12px rgba(251, 191, 36, 0.5);
    animation: selectPulse 0.3s ease-out;
}

.section:nth-child(5) .rating-btn.selected {
    background: var(--accent-rose);
    border-color: rgba(255, 255, 255, 0.9);
    color: white;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.3),
                0 4px 12px rgba(251, 113, 133, 0.5);
    animation: selectPulse 0.3s ease-out;
}

/* Hover state for selected buttons */
.rating-btn.selected:hover {
    transform: scale(1.12);
}

/* Disabled state - clearly muted */
.rating-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.rating-btn:disabled:hover {
    transform: scale(0.95);
    box-shadow: none;
}

/* Selection animation */
@keyframes selectPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Touch-friendly active state */
.rating-btn:active:not(:disabled) {
    transform: scale(0.98);
    transition-duration: 0.1s;
}

.form-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-subtle);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    .image-container-fifth {
        width: 100%;
    }
    
    .container {
        padding: 10px;
    }
    
    fieldset {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .rating-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    /* Mobile Banner Height - With Top Alignment */
    .header-banner {
        max-height: 180px;
        border-radius: 8px;
        margin-bottom: 20px;
        /* object-position already set above, applies here too */
    }
}

/* Focus styles for accessibility */
.rating-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    z-index: 1;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Error state */
input.error,
select.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.15);
}

/* Success state */
input.success,
select.success {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(81, 207, 102, 0.15);
}

/* Global validation error message */
.global-error-message {
    background: rgba(255, 107, 107, 0.15);
    border: 2px solid var(--error-color);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: var(--error-color);
    font-weight: 600;
    text-align: center;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.global-error-message.show {
    display: block;
}

.global-error-message ul {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
}

.global-error-message li {
    padding: 4px 0;
    font-weight: 500;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}