:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #0f172a;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius: 12px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --ring: rgba(37, 99, 235, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Background aesthetic */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.1), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

.form-container {
    background: var(--surface);
    width: 100%;
    max-width: 800px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.form-header h1 {
    font-size: 2rem;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.form-section {
    margin-bottom: 2.5rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-section:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.form-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.25rem;
    background: var(--primary);
    border-radius: 2px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: var(--surface);
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '\25BC';
    font-size: 0.7rem;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

select {
    appearance: none;
    padding-right: 2.5rem;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    transition: all 0.2s ease;
    user-select: none;
}

.radio-label:hover,
.checkbox-label:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

input[type="radio"],
input[type="checkbox"] {
    accent-color: var(--primary);
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.radio-label:has(input:checked),
.checkbox-label:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
    font-weight: 500;
}

.checkbox-with-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-input {
    width: 70px !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.9rem !important;
    text-align: center;
}

.qty-input:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

/* For hiding/showing conditional fields */
.hidden {
    display: none !important;
}

.form-actions {
    margin-top: 3rem;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -2px rgba(37, 99, 235, 0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -4px rgba(37, 99, 235, 0.2);
}

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

.success-alert {
    background-color: #dcfce7;
    border: 1px solid #22c55e;
    color: #166534;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease-out;
}

.success-alert::before {
    content: '✓';
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #22c55e;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-container {
        padding: 1.5rem;
    }
}
