:root {
    /* Calm & Soothing Color Palette */
    --primary-color: #14b8a6;
    --primary-dark: #0d9488;
    --primary-light: #5eead4;
    --secondary-color: #0ea5e9;
    --secondary-dark: #0284c7;

    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #f59e0b;

    --text-primary: #334155;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-gradient: linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%);
    --bg-gradient-soft: linear-gradient(135deg, #e0f2fe 0%, #ccfbf1 100%);

    --border-color: #e2e8f0;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 20px;

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 24px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, 0.12);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background: var(--bg-gradient-soft);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.company-name {
    font-size: 1.35rem;
    font-weight: 700;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Form Card */
.form-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-header {
    background: var(--bg-gradient);
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
}

.form-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.form-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Progress Bar */
.progress-container {
    background: var(--bg-secondary);
    padding: 1.75rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 1rem;
}

.progress-line {
    position: absolute;
    top: 20px;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--border-color);
    z-index: 1;
}

.progress-line-fill {
    height: 100%;
    background: var(--bg-gradient);
    transition: width 0.5s ease;
    border-radius: 2px;
}

.progress-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: var(--transition);
}

.progress-step.active .step-circle {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .step-circle {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

.progress-step.active .step-label {
    color: var(--primary-color);
}

/* Form Content */
.form-content {
    padding: 2.5rem 2rem;
}

.form-stage {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-stage.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stage-title {
    font-size: 1.65rem;
    color: var(--text-primary);
    margin-bottom: 1.75rem;
    padding-bottom: 0.875rem;
    border-bottom: 3px solid var(--primary-color);
    font-weight: 700;
}

/* Form Groups */
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

/* Special 4-column row */
.form-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group label.required::after {
    content: ' *';
    color: var(--error-color);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
}

.form-control:disabled {
    background: var(--bg-secondary);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

.form-control.error {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

.form-control.error+.error-message {
    display: block;
}

/* Repeatable Sections */
.repeatable-section {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    position: relative;
}

.repeatable-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.repeatable-section .section-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.btn-remove {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-remove:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-add {
    background: linear-gradient(135deg, var(--success-color) 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

.btn-add:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Declaration */
.declaration-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.declaration-text {
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-group label {
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Success Message */
.success-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.success-overlay.active {
    display: flex;
}

.success-message {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    max-width: 500px;
    margin: 1rem;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 3rem;
}

.success-message h2 {
    color: var(--success-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Message Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.modal-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }

    .logo {
        height: 45px;
    }

    .company-name {
        font-size: 1.2rem;
    }

    .container {
        margin: 1rem auto;
    }

    .form-header h1 {
        font-size: 1.5rem;
    }

    .form-header p {
        font-size: 1rem;
    }

    .progress-container {
        padding: 1.5rem 1rem;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .form-content {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .form-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-actions {
        flex-direction: column-reverse;
        padding: 1.5rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {

    .form-row,
    .form-row-4 {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {

    .header,
    .progress-container,
    .form-actions {
        display: none;
    }

    .form-card {
        box-shadow: none;
    }
}