:root {
    /* Color Palette - Premium Medical/Tech */
    --primary: #4c1d95;
    /* Deep Purple */
    --primary-light: #6d28d9;
    --secondary: #10b981;
    /* Success Green */
    --secondary-hover: #059669;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --error: #ef4444;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    line-height: 1.5;
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-muted);
}

/* --- Layout & Card --- */
.container {
    width: 100%;
    max-width: 640px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 0;
    /* Removed padding to allow banner to touch edges */
    overflow: hidden;
    position: relative;
}

/* --- Mobile Optimizations --- */
@media (max-width: 640px) {
    body {
        padding: var(--spacing-xs);
        justify-content: flex-start;
        /* Allow scrolling on small screens */
    }

    .container {
        padding: 0;
        /* Keep 0 padding on mobile too */
        border-radius: var(--radius-md);
        box-shadow: none;
        /* Flatter look on mobile */
        min-height: auto;
        /* Let content dictate height */
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }
}

/* --- Components --- */
.logo-banner {
    background-color: var(--primary);
    padding: var(--spacing-md);
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-content {
    padding: var(--spacing-lg);
}

@media (max-width: 640px) {
    .card-content {
        padding: var(--spacing-md);
    }
}

.logo {
    height: 3rem;
    display: block;
    /* Logo is already on purple, no margin needed */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    /* Large touch target */
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    min-height: 48px;
    /* Accessibility minimum */
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(76, 29, 149, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: #f3e8ff;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

@media (min-width: 640px) {
    .btn-group {
        flex-direction: row;
    }
}

/* --- Forms --- */
.form-group {
    margin-bottom: var(--spacing-md);
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    /* Prevents iOS zoom */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 29, 149, 0.1);
}

/* --- Radio Cards (Yes/No) --- */
.radio-group {
    display: flex;
    gap: var(--spacing-sm);
}

.radio-card {
    flex: 1;
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.radio-card-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
    background: white;
}

.radio-card input:checked+.radio-card-content {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(76, 29, 149, 0.3);
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-purple {
    color: var(--primary);
}

.text-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #dcfce7;
    color: #166534;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

/* --- Animations --- */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-sm);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Study Highlights --- */
.highlights-container {
    margin-top: 3rem;
    background: #f8fafc;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    text-align: left;
}

.highlights-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.05em;
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

/* Remove border from last item */
.highlight-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* First item pt-0 if we want tight spacing, but standard padding is fine */

.highlight-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: #f3e8ff;
    /* Light purple to match screenshot bg */
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    /* Icon color */
    margin-right: var(--spacing-md);
}

.highlight-text strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.highlight-text p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.4;
}

@media (max-width: 640px) {
    .highlights-container {
        padding: var(--spacing-md);
        margin-top: 2rem;
    }

    .highlight-icon {
        width: 36px;
        height: 36px;
        margin-right: var(--spacing-sm);
    }
}

/* --- Checkbox Cards (Multi-Location) --- */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.checkbox-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
}

.checkbox-card:hover {
    border-color: var(--primary-light);
    background: #faf5ff;
}

.checkbox-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: var(--spacing-sm);
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-card-content {
    font-weight: 500;
    color: var(--text-main);
}

.checkbox-card:has(input:checked) {
    border-color: var(--primary);
    background: #f3e8ff;
}

.checkbox-card-none {
    border-color: #fecaca;
    background: #fef2f2;
}

.checkbox-card-none:hover {
    border-color: #f87171;
    background: #fee2e2;
}

.checkbox-card-none:has(input:checked) {
    border-color: var(--error);
    background: #fee2e2;
}