:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --secondary: #3498db;
    --secondary-light: #5dade2;
    --accent: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --gray-dark: #343a40;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    color: var(--gray-dark);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 20px;
    text-align: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.header p {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--secondary);
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 8px;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 24px;
    right: 24px;
    height: 3px;
    background: var(--gray-light);
    transform: translateY(-50%);
    z-index: 0;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.progress-step.active {
    background: var(--secondary);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

.progress-step.completed {
    background: var(--success);
    color: var(--white);
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--primary);
}

.form-group label .required {
    color: var(--accent);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-control.error {
    border-color: var(--danger);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Radio / Toggle */
.radio-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

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

.radio-option input {
    position: absolute;
    opacity: 0;
}

.radio-option label {
    display: block;
    padding: 12px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.radio-option input:checked + label {
    border-color: var(--secondary);
    background: rgba(52, 152, 219, 0.08);
    color: var(--secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--secondary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-light);
}

.btn-primary:disabled {
    background: var(--gray);
    cursor: not-allowed;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

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

.btn-outline:hover {
    border-color: var(--gray);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-group .btn {
    flex: 1;
}

/* Step visibility */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Photo Upload */
.photo-upload-area {
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.photo-upload-area:hover,
.photo-upload-area.dragover {
    border-color: var(--secondary);
    background: rgba(52, 152, 219, 0.05);
}

.photo-upload-area i {
    font-size: 2.5rem;
    color: var(--gray);
    margin-bottom: 8px;
}

.photo-upload-area p {
    color: var(--gray);
    font-size: 0.9rem;
}

.photo-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Signature */
.signature-container {
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    background: var(--white);
    position: relative;
    min-height: 200px;
}

.signature-container canvas {
    touch-action: none !important;
    -ms-touch-action: none !important;
}

.signature-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    color: #1a8a4a;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: #2471a3;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

/* Loading */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning { background: rgba(243,156,18,0.15); color: #d68910; }
.badge-info { background: rgba(52,152,219,0.15); color: #2471a3; }
.badge-success { background: rgba(46,204,113,0.15); color: #1a8a4a; }
.badge-danger { background: rgba(231,76,60,0.15); color: #c0392b; }

/* Confirmation screen */
.confirmation {
    text-align: center;
    padding: 40px 20px;
}

.confirmation .icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 20px;
}

.confirmation h2 {
    color: var(--primary);
    margin-bottom: 8px;
}

.confirmation .reference {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    background: rgba(52, 152, 219, 0.1);
    padding: 8px 16px;
    border-radius: var(--radius);
    display: inline-block;
    margin: 12px 0;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--secondary);
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--gray); }
.text-small { font-size: 0.85rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 12px; }
    .card { padding: 16px; }
    .header h1 { font-size: 1.3rem; }
    .btn-group { flex-direction: column; }
    .radio-group { flex-direction: column; }
}
