* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    bottom: -100px;
    right: -100px;
    animation-delay: 7s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Form Wrapper */
.form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Header */
.form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.form-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.form-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.form-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Alerts */
.alert {
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 2rem;
    border-radius: 12px;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid var(--error-color);
    color: #991b1b;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.alert strong {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.alert ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Form Sections */
form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    margin-right: 0.75rem;
    border-radius: 2px;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.required {
    color: var(--error-color);
    margin-left: 0.25rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
}

.radio-label:hover {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.radio-label input[type="radio"] {
    margin-right: 0.75rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked+span {
    font-weight: 600;
    color: var(--primary-color);
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    transform: translateY(-2px);
}

.file-upload-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.file-upload-text {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.file-upload-wrapper input[type="file"]:focus+.file-upload-label {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    transform: translateY(-2px);
}

/* Responsive Design */

/* Extra Small Devices (Phones, less than 480px) */
@media (max-width: 480px) {
    body {
        padding: 0.5rem 0.25rem;
    }

    .container {
        padding: 0;
    }

    .form-wrapper {
        border-radius: 16px;
        margin: 0.5rem 0;
    }

    .form-header {
        padding: 2rem 1rem;
    }

    .form-header h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .form-header p {
        font-size: 0.875rem;
    }

    form {
        padding: 1rem;
    }

    .form-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }

    .section-title {
        font-size: 1.1rem;
        flex-wrap: wrap;
    }

    .section-title::before {
        height: 20px;
        width: 3px;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group textarea {
        padding: 0.75rem 1rem;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .radio-label {
        min-width: 100%;
        padding: 0.75rem 1rem;
        justify-content: flex-start;
    }

    .radio-label input[type="radio"] {
        width: 18px;
        height: 18px;
    }

    .file-upload-label {
        padding: 1.5rem 1rem;
    }

    .file-upload-icon {
        font-size: 2rem;
    }

    .file-upload-text {
        font-size: 0.9rem;
    }

    .file-upload-hint {
        font-size: 0.75rem;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }

    .btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .alert {
        margin: 1rem 0.5rem;
        padding: 1rem;
        font-size: 0.9rem;
    }

    /* Reduce blob sizes for small screens */
    .blob-1 {
        width: 250px;
        height: 250px;
    }

    .blob-2 {
        width: 200px;
        height: 200px;
    }

    .blob-3 {
        width: 180px;
        height: 180px;
    }
}

/* Small Devices (Phones, 481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .form-header {
        padding: 2.5rem 1.5rem;
    }

    .form-header h1 {
        font-size: 1.875rem;
    }

    .form-header p {
        font-size: 1rem;
    }

    form {
        padding: 1.5rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-label {
        min-width: 100%;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }

    .alert {
        margin: 1rem;
    }
}

/* Medium Devices (Tablets, 769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 700px;
    }

    .form-header h1 {
        font-size: 2.25rem;
    }

    .radio-group {
        gap: 0.75rem;
    }

    .radio-label {
        min-width: 140px;
        padding: 0.75rem 1.25rem;
    }

    .form-section:hover {
        transform: translateY(-1px);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Remove hover effects on touch devices */
    .form-section:hover {
        transform: none;
        box-shadow: none;
    }

    .radio-label:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    /* Increase touch targets */
    .radio-label {
        min-height: 48px;
    }

    .btn {
        min-height: 48px;
    }

    /* Better tap highlighting */
    * {
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
    }
}

/* Landscape Orientation for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .form-header {
        padding: 1.5rem 2rem;
    }

    .form-header h1 {
        font-size: 1.5rem;
    }

    .form-header p {
        font-size: 0.9rem;
    }

    .form-section {
        padding: 1.25rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .form-wrapper {
        border: 0.5px solid rgba(255, 255, 255, 0.2);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .background-animation {
        display: none;
    }

    .form-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .form-header {
        background: #667eea;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .btn {
        display: none;
    }

    .form-actions {
        display: none;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}