/* Integration Request Form Styles */

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

body {
    font-family: 'Cairo', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* RTL Support */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}

html[dir="rtl"] .form-layout {
    direction: rtl;
    grid-template-columns: 1fr 300px;
}

html[dir="rtl"] .progress-sidebar {
    order: 2;
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .progress-sidebar h3 {
    text-align: right;
}

html[dir="rtl"] .form-content {
    order: 1;
}

html[dir="rtl"] .form-actions {
    flex-direction: row-reverse;
}

html[dir="rtl"] .back-link {
    flex-direction: row-reverse;
}

html[dir="rtl"] .back-link::before {
    content: "→";
    transform: rotate(180deg);
    display: inline-block;
}

html[dir="ltr"] .back-link::before {
    content: "←";
}

html[dir="rtl"] .form-group label {
    text-align: right;
}

html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group select,
html[dir="rtl"] .form-group textarea {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"] {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] textarea {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] select {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .form-row {
    flex-direction: row-reverse;
}

html[dir="rtl"] .checkbox-group {
    flex-direction: row-reverse;
}

html[dir="rtl"] .toggle-question {
    text-align: right;
}

html[dir="rtl"] .toggle-buttons {
    flex-direction: row-reverse;
}

html[dir="rtl"] .progress-step {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .step-icon {
    margin-left: 10px;
    margin-right: 0;
}

html[dir="rtl"] .step-label {
    text-align: right;
}

html[dir="rtl"] .section-header {
    flex-direction: row-reverse;
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .section-header h2 {
    text-align: right;
    margin-left: 0;
    margin-right: 10px;
}

html[dir="rtl"] .section-header span {
    margin-left: 0;
    margin-right: 0;
}

html[dir="rtl"] .collapsible-header {
    flex-direction: row-reverse;
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .section-toggle-icon {
    margin-left: 0;
    margin-right: auto;
}

html[dir="rtl"] .standards-grid {
    direction: rtl;
}

html[dir="rtl"] .integration-methods {
    direction: rtl;
}

.header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: #64748b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.back-link::before {
    content: "←";
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-switcher {
    position: relative;
}

.language-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s;
}

.language-switcher-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.language-switcher-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 150px;
    display: none;
    z-index: 1000;
}

html[dir="rtl"] .language-switcher-menu {
    right: auto;
    left: 0;
}

.language-switcher.active .language-switcher-menu {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: #1e293b;
}

.language-option:hover {
    background: #f8fafc;
}

.language-option.active {
    background: #f1f5f9;
    color: #7366FF;
    font-weight: 600;
}

.container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 40px;
}

.page-title {
    text-align: center;
    margin-bottom: 10px;
}

.page-title h1 {
    font-size: 32px;
    color: #1e293b;
    font-weight: 600;
}

.page-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 16px;
    margin-bottom: 40px;
}

.form-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.progress-sidebar {
    background: white;
    border-radius: 16px;
    padding: 30px;
    height: fit-content;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.progress-sidebar h3 {
    font-size: 18px;
    margin-bottom: 25px;
    color: #1e293b;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.progress-step:hover {
    background: #f8fafc;
}

.progress-step.active {
    background: #eff6ff;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.progress-step .step-icon {
    background: #e2e8f0;
    color: #64748b;
}

.progress-step.active .step-icon {
    background: #3b82f6;
    color: white;
}

.progress-step.completed .step-icon {
    background: #10b981;
    color: white;
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.form-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-section {
    display: block;
    margin-bottom: 30px;
}

.collapsible-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.collapsible-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.collapsible-section.expanded {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    border-bottom: 1px solid #e2e8f0;
}

.collapsible-header:hover {
    background: #f8fafc;
}

.collapsible-header h2 {
    margin: 0;
    flex: 1;
}

.section-toggle-icon {
    font-size: 14px;
    color: #64748b;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.collapsible-section.expanded .section-toggle-icon {
    transform: rotate(0deg);
}

.collapsible-section:not(.expanded) .section-toggle-icon {
    transform: rotate(-90deg);
}

.section-content {
    padding: 24px;
    display: none;
}

.collapsible-section.expanded .section-content {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h2 {
    font-size: 24px;
    color: #1e293b;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #334155;
}

label .required {
    color: #ef4444;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.2s;
}

/* Remove default select arrow and add custom one */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    padding-right: 40px;
}

html[dir="rtl"] select {
    background-position: left 12px center;
    padding-right: 16px;
    padding-left: 40px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.form-actions .info-box {
    margin-bottom: 0;
}

.form-actions .btn-primary {
    align-self: flex-end;
}

.btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-secondary {
    background: white;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-body {
    padding: 24px;
    color: #374151;
    line-height: 1.6;
}

.modal-body p {
    margin: 0;
    font-size: 16px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

html[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .modal-footer {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.note-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    color: #92400e;
    font-size: 14px;
}

html[dir="rtl"] .note-box {
    text-align: right;
    direction: rtl;
}

.review-list {
    padding-left: 20px;
    padding-right: 0;
}

html[dir="rtl"] .review-list {
    padding-right: 20px;
    padding-left: 0;
    direction: rtl;
}

html[dir="rtl"] ol {
    padding-right: 20px;
    padding-left: 0;
    direction: rtl;
}

html[dir="rtl"] ol li {
    text-align: right;
}

/* Yes/No Toggle Buttons */
.toggle-question {
    margin-bottom: 25px;
}

.toggle-question-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 14px;
    color: #334155;
}

.toggle-question-label .required {
    color: #ef4444;
}

.toggle-buttons {
    display: inline-flex;
    border-radius: 8px;
    background: #f1f5f9;
    padding: 4px;
    gap: 4px;
}

.toggle-buttons input[type="radio"] {
    display: none;
}

.toggle-btn {
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
    background: transparent;
    border: none;
    min-width: 80px;
    text-align: center;
}

.toggle-btn:hover {
    background: #e2e8f0;
}

.toggle-buttons input[type="radio"]:checked + .toggle-btn {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-buttons input[type="radio"]:checked + .toggle-btn.btn-yes {
    background: #3b82f6;
    color: white;
}

.toggle-buttons input[type="radio"]:checked + .toggle-btn.btn-no {
    background: #64748b;
    color: white;
}

/* Conditional Sections */
.conditional-section {
    display: none;
    margin-top: 24px;
    animation: fadeIn 0.3s ease-in;
}

.conditional-section.active {
    display: block;
}

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

/* IMS Standards Categories */
.standards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.standard-category {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.standard-category:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.category-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.category-description {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.category-arrow {
    font-size: 20px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.standard-category:hover .category-arrow {
    transform: translateX(4px);
}

/* Standards Options */
.standards-options {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.standards-options.active {
    display: block;
}

.back-to-categories {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3b82f6;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 8px 16px;
    border-radius: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.back-to-categories:hover {
    background: #f1f5f9;
}

.category-title-bar {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.option-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.option-item:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.option-item:active {
    transform: translateY(0);
}

.option-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.option-content {
    flex: 1;
}

.option-name {
    font-weight: 500;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.option-description {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.info-icon {
    color: #94a3b8;
    font-size: 16px;
    cursor: help;
}

.explore-categories {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.explore-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.explore-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Alternative Integration Methods */
.integration-methods {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.method-option {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.method-option:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.method-option:active {
    transform: translateY(0);
}

.method-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* Form Validation Styles */
.is-invalid {
    border-color: #ef4444 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

html[dir="rtl"] .is-invalid {
    background-position: left 12px center;
    padding-right: 12px;
    padding-left: 40px;
}

.is-valid {
    border-color: #10b981 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%2310b981'%3e%3cpath stroke-linejoin='round' stroke-linecap='round' d='M10 3L4.5 8.5L2 6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

html[dir="rtl"] .is-valid {
    background-position: left 12px center;
    padding-right: 12px;
    padding-left: 40px;
}

.is-invalid-label {
    color: #ef4444 !important;
}

.validation-error {
    display: block;
    width: 100%;
    margin-top: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #ef4444;
    line-height: 1.5;
}

.form-group {
    position: relative;
}

.form-group .validation-error {
    animation: fadeIn 0.2s ease-in;
}

/* Ensure validation error and character counter don't overlap */
.form-group .validation-error + .character-counter {
    margin-top: 4px;
}

input.is-invalid:focus,
select.is-invalid:focus,
textarea.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    outline: none;
}

input.is-valid:focus,
select.is-valid:focus,
textarea.is-valid:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    outline: none;
}

/* Radio button validation */
input[type="radio"].is-invalid {
    background-image: none;
    padding-right: 0;
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

html[dir="rtl"] input[type="radio"].is-invalid {
    padding-left: 0;
}

.toggle-question .validation-error {
    margin-top: 8px;
    margin-bottom: 0;
}

/* Select validation */
select.is-invalid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e"),
                        url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-position: right 35px center, right 12px center;
    background-size: 16px 16px, 12px 12px;
    padding-right: 60px;
}

html[dir="rtl"] select.is-invalid {
    background-position: left 35px center, left 12px center;
    padding-right: 16px;
    padding-left: 60px;
}

select.is-valid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%2310b981'%3e%3cpath stroke-linejoin='round' stroke-linecap='round' d='M10 3L4.5 8.5L2 6'/%3e%3c/svg%3e"),
                        url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-position: right 35px center, right 12px center;
    background-size: 16px 16px, 12px 12px;
    padding-right: 60px;
}

html[dir="rtl"] select.is-valid {
    background-position: left 35px center, left 12px center;
    padding-right: 16px;
    padding-left: 60px;
}

/* Validation Summary */
.validation-summary {
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

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

/* Character counter for textareas */
.character-counter {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    margin-bottom: 0;
    text-align: right;
    display: block;
    clear: both;
    line-height: 1.4;
}

html[dir="rtl"] .character-counter {
    text-align: left;
}

.character-counter.warning {
    color: #f59e0b;
}

.character-counter.error {
    color: #ef4444;
}

/* When validation error is present, adjust character counter spacing */
.form-group:has(.validation-error) .character-counter {
    margin-top: 4px;
}

/* Fallback for browsers that don't support :has() */
.form-group .validation-error ~ .character-counter {
    margin-top: 4px;
}

/* Textarea validation */
textarea.is-invalid {
    background-position: top 12px right 12px;
    padding-right: 40px;
}

html[dir="rtl"] textarea.is-invalid {
    background-position: top 12px left 12px;
    padding-right: 12px;
    padding-left: 40px;
}

textarea.is-valid {
    background-position: top 12px right 12px;
    padding-right: 40px;
}

html[dir="rtl"] textarea.is-valid {
    background-position: top 12px left 12px;
    padding-right: 12px;
    padding-left: 40px;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .form-layout {
        grid-template-columns: 1fr;
    }
    
    .progress-sidebar {
        order: -1;
        margin-bottom: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 20px;
    }
    
    .header {
        padding: 15px 20px;
    }
}

/* ============================================
   Spinner Animation for Submit Button
   ============================================ */

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

/* Disabled submit button state */
button[type="submit"]:disabled {
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    pointer-events: none;
}

/* Prevent button text selection during submission */
button[type="submit"].submitting {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

