/* CSS Variables matching the design reference */
:root {
    --background: hsl(120, 20%, 98%);
    --foreground: hsl(240, 10%, 15%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(240, 10%, 15%);
    --popover: hsl(0, 0%, 100%);
    --popover-foreground: hsl(240, 10%, 15%);
    --primary: hsl(158, 64%, 52%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(217, 91%, 60%);
    --secondary-foreground: hsl(0, 0%, 100%);
    --muted: hsl(215, 25%, 27%);
    --muted-foreground: hsl(215, 16%, 60%);
    --accent: hsl(43, 96%, 56%);
    --accent-foreground: hsl(240, 10%, 15%);
    --destructive: hsl(0, 84%, 60%);
    --destructive-foreground: hsl(0, 0%, 100%);
    --border: hsl(214, 32%, 91%);
    --input: hsl(214, 32%, 91%);
    --ring: hsl(158, 64%, 52%);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --radius: 0.75rem;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: hsl(var(--foreground));
    background-color: hsl(var(--background));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-accent { background-color: hsl(var(--accent)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-destructive { background-color: hsl(var(--destructive)); }

.text-foreground { color: hsl(var(--foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-secondary { color: hsl(var(--secondary)); }
.text-accent { color: hsl(var(--accent)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-secondary-foreground { color: hsl(var(--secondary-foreground)); }
.text-accent-foreground { color: hsl(var(--accent-foreground)); }

.border-border { border-color: hsl(var(--border)); }
.border-input { border-color: hsl(var(--input)); }

/* Layout */
.min-h-screen { min-height: 100vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-lg { max-width: 32rem; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.h-auto { height: auto; }

.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.grid { display: grid; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.pt-6 { padding-top: 1.5rem; }

.m-4 { margin: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-4 { margin-right: 1rem; }
.ml-2 { margin-left: 0.5rem; }

/* Typography */
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

/* Border and Radius */
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }

/* Shadows */
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Positioning */
.relative { position: relative; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }
.block { display: block; }

/* Screen visibility */
.hidden { display: none !important; }
.screen {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Buttons */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    text-decoration: none;
}

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

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button:hover:not(:disabled) {
    opacity: 0.9;
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid hsl(var(--input));
    border-radius: 0.75rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

input::placeholder {
    color: hsl(var(--muted-foreground));
}

label {
    display: block;
    font-weight: 600;
    color: hsl(var(--foreground));
}

/* Progress bar */
.progress-bar-fill {
    transition: width 0.4s ease-out;
}

.score-bar {
    transition: width 0.8s ease-out;
    transition-delay: 0.2s;
}

/* Slider styling */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: hsl(var(--muted) / 0.2);
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: hsl(var(--primary));
    cursor: pointer;
    border: 2px solid hsl(var(--background));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: hsl(var(--primary));
    cursor: pointer;
    border: 2px solid hsl(var(--background));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Radio button custom styling */
.radio-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover {
    background-color: hsl(var(--muted) / 0.1);
    border-color: hsl(var(--primary) / 0.5);
}

.radio-option.selected {
    border-color: hsl(var(--primary) / 0.5);
    background-color: hsl(var(--primary) / 0.05);
}

.radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid hsl(var(--muted));
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.radio-dot-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: hsl(var(--primary));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.radio-option.selected .radio-dot {
    border-color: hsl(var(--primary));
}

.radio-option.selected .radio-dot-inner {
    opacity: 1;
}

/* Icon sizing */
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-16 { width: 4rem; }

.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-16 { height: 4rem; }

/* Spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Hover and focus states */
.hover\:bg-primary\/90:hover { background-color: hsl(var(--primary) / 0.9); }
.hover\:bg-secondary\/90:hover { background-color: hsl(var(--secondary) / 0.9); }
.hover\:bg-accent\/90:hover { background-color: hsl(var(--accent) / 0.9); }
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:scale-\[1\.02\]:hover { transform: scale(1.02); }

/* Focus states */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2); }

/* Responsive design */
@media (min-width: 768px) {
    .md\:text-5xl { font-size: 3rem; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid { gap: 1.5rem; }
}

/* Light blue button styling */
.btn-light-blue {
    background-color: hsl(210, 100%, 85%);
    color: hsl(210, 100%, 20%);
    border: 1px solid hsl(210, 100%, 85%);
    transition: all 0.2s ease;
}

.btn-light-blue:hover {
    background-color: hsl(210, 100%, 80%);
    border-color: hsl(210, 100%, 80%);
    transform: translateY(-1px);
}

.btn-light-blue:active {
    background-color: hsl(210, 100%, 75%);
    transform: translateY(0);
}

/* Radio option styling with light blue theme */
.radio-option-light-blue {
    background-color: hsl(210, 100%, 85%);
    color: hsl(210, 100%, 20%);
    border: 2px solid hsl(210, 100%, 85%);
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option-light-blue:hover {
    background-color: hsl(210, 100%, 80%);
    border-color: hsl(210, 100%, 80%);
    transform: translateY(-1px);
}

.radio-option-light-blue.selected {
    background-color: hsl(210, 100%, 75%);
    border-color: hsl(210, 100%, 20%);
    box-shadow: 0 0 0 3px hsl(210, 100%, 85%, 0.3);
}

.auto-advance-transition {
    animation: pulseSelect 0.3s ease-in-out;
}

@keyframes pulseSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Enhanced form input styling */
.form-input-enhanced {
    border: 2px solid var(--border, #e2e8f0);
    background-color: var(--background, #ffffff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px;
    width: 100%;
}

.form-input-enhanced:hover {
    border-color: hsl(210, 100%, 85%);
}

.form-input-enhanced:focus {
    outline: none;
    border-color: hsl(210, 100%, 85%);
    box-shadow: 0 0 0 3px hsl(210, 100%, 85%, 0.3);
    background-color: var(--card, #ffffff);
}

.form-input-enhanced::placeholder {
    color: var(--muted-foreground, #64748b);
    opacity: 0.7;
}

/* Enhanced label styling */
.form-label-enhanced {
    font-weight: 600;
    color: var(--foreground, #1e293b);
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
}

/* Modal styling enhancements */
.calendar-container {
    max-height: 550px;
    overflow: auto;
    border-radius: 12px;
}

.calendar-container iframe {
    border-radius: 8px;
}

/* Ensure modal appears above everything */
.z-50 {
    z-index: 9999 !important;
}

/* Color opacity utilities */
.bg-primary\/10 { background-color: hsl(var(--primary) / 0.1); }
.bg-primary\/5 { background-color: hsl(var(--primary) / 0.05); }
.bg-accent\/10 { background-color: hsl(var(--accent) / 0.1); }
.bg-muted\/10 { background-color: hsl(var(--muted) / 0.1); }
.bg-muted\/20 { background-color: hsl(var(--muted) / 0.2); }
.bg-destructive\/10 { background-color: hsl(var(--destructive) / 0.1); }

.border-primary\/50 { border-color: hsl(var(--primary) / 0.5); }
.border-destructive\/20 { border-color: hsl(var(--destructive) / 0.2); }

/* Object fit */
.object-cover { object-fit: cover; }

/* Transform and transition utilities */
.transform { transform: translateX(var(--tw-translate-x, 0)) translateY(var(--tw-translate-y, 0)) rotate(var(--tw-rotate, 0)) skewX(var(--tw-skew-x, 0)) skewY(var(--tw-skew-y, 0)) scaleX(var(--tw-scale-x, 1)) scaleY(var(--tw-scale-y, 1)); }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }

/* Gap utilities for grid */
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Gradient background */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-primary {
    --tw-gradient-from: hsl(var(--primary));
    --tw-gradient-to: hsl(var(--primary) / 0);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-secondary {
    --tw-gradient-to: hsl(var(--secondary));
}
