:root {
    --primary-color: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #f0fdfa;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --background: #f3f4f6;
    --border-color: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px 12px;
    direction: rtl;
    transition: direction 0.3s ease;
}

.app-container {
    max-width: 620px;
    margin: 0 auto;
}

/* Utility Bar & Lang Selector */
.utility-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.lang-selector {
    display: flex;
    background-color: #ffffff;
    padding: 4px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-lang {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    transition: all 0.2s ease;
}

.btn-lang.active {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-lang:hover:not(.active) {
    color: var(--primary-color);
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 24px;
}

.app-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.06));
}

.app-header h1 {
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.privacy-badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(229, 231, 235, 0.7);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.welcome-card {
    font-size: 13.5px;
    color: var(--text-secondary);
    border-right: 5px solid var(--primary-color);
}

/* Specialist Card */
.specialist-card {
    border-right: 5px solid var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
}

.specialist-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.specialist-info .avatar-icon {
    font-size: 36px;
    background: #ffffff;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.specialist-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.specialist-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Info Card (Steps & Security) */
.info-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.steps-container h3, .security-container h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.steps-container ol {
    margin-right: 18px;
    font-size: 12px;
    color: var(--text-secondary);
}

.steps-container ol li {
    margin-bottom: 4px;
}

.security-container p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Error Card */
.error-card {
    text-align: center;
    border-top: 5px solid #3b82f6; /* لون أزرق مطمئن ومساعد */
    padding: 36px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}

.error-illustration {
    font-size: 38px;
    margin-bottom: 16px;
    background-color: #eff6ff;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
    border: 1px solid #dbeafe;
}

.error-card h2 {
    font-size: 17px;
    color: #1e3a8a; /* كحلي مريح */
    font-weight: 800;
    margin-bottom: 10px;
}

.error-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.instructions-box {
    text-align: right;
    background-color: #f0f9ff; /* خلفية زرقاء للمساعدة */
    border-radius: 20px;
    padding: 20px 24px;
    border: 1px solid #e0f2fe;
}

.instructions-box h4 {
    font-size: 12.5px;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 8px;
}

.instructions-box ul {
    margin-right: 18px;
    font-size: 11.5px;
    color: #0c4a6e;
    line-height: 1.6;
}

.instructions-box ul li {
    margin-bottom: 4px;
}

/* Accordions */
.accordion-section {
    padding: 0;
    overflow: hidden;
}

.accordion-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    background-color: #ffffff;
    user-select: none;
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background-color: var(--primary-light);
}

.accordion-header .icon {
    font-size: 22px;
    margin-left: 14px;
}

.accordion-header h3 {
    font-size: 14.5px;
    font-weight: 700;
    flex-grow: 1;
    color: var(--text-primary);
}

.accordion-header .arrow {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.accordion-section.active .accordion-header .arrow {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background-color: #ffffff;
    animation: slideDown 0.3s ease-out;
}

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

.accordion-section.active .accordion-content {
    display: block;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border-color);
    font-family: inherit;
    font-size: 13px;
    background-color: #ffffff;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--primary-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 12px;
    transition: all 0.2s ease;
}

.file-drop-zone:hover {
    background-color: rgba(13, 148, 136, 0.08);
    border-color: var(--primary-hover);
}

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

.thumbnail-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    aspect-ratio: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-container .pdf-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fee2e2;
    color: #ef4444;
    font-size: 18px;
    font-weight: 800;
}

.thumbnail-container .btn-remove {
    position: absolute;
    top: 6px;
    left: 6px;
    background-color: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.thumbnail-container .btn-remove:hover {
    background-color: rgba(239, 68, 68, 0.9);
}

/* Chips / Tag Input */
.chips-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chips-container input {
    flex-grow: 1;
}

.btn-add {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 0 20px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: background-color 0.2s;
}

.btn-add:hover {
    background-color: var(--primary-hover);
}

.chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(13, 148, 136, 0.15);
    animation: scaleUp 0.2s ease-out;
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.chip .btn-close {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 18px;
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2), 0 2px 4px -1px rgba(13, 148, 136, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.3), 0 4px 6px -2px rgba(13, 148, 136, 0.15);
}

.btn-secondary {
    background: none;
    border: 1.5px dashed var(--primary-color);
    color: var(--primary-color);
    border-radius: 14px;
    padding: 12px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    transition: all 0.2s ease;
    margin-top: 10px;
}

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

.submit-panel {
    text-align: center;
    margin-top: 24px;
}

.crypto-note {
    font-size: 10.5px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 40px 16px 20px 16px;
    color: var(--text-secondary);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.app-footer .branding {
    font-weight: 700;
    font-size: 11.5px;
    margin: 4px 0;
}

.brand-link {
    color: var(--primary-color);
    text-decoration: none;
}

.brand-link:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Processing Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    text-align: center;
}

.spinner-container {
    padding: 24px;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 4.5px solid var(--border-color);
    border-top: 4.5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#overlay-status {
    font-size: 18px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 8px;
}

#overlay-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* LTR Compatibility */
body.ltr {
    direction: ltr;
}
body.ltr .welcome-card, 
body.ltr .specialist-card {
    border-right: none;
    border-left: 5px solid var(--primary-color);
}
body.ltr .instructions-box {
    text-align: left;
}
body.ltr .instructions-box ul,
body.ltr .steps-container ol {
    margin-right: 0;
    margin-left: 18px;
}
body.ltr .accordion-header .icon {
    margin-left: 0;
    margin-right: 14px;
}
body.ltr .chip .btn-close {
    margin-left: 0;
    margin-right: 8px;
}

/* Modal Overlay & Card for Success Submission */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.modal-card {
    background-color: #ffffff;
    max-width: 480px;
    width: 100%;
    padding: 32px 24px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    animation: modalSlideUp 0.3s ease-out;
}

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

.modal-card .success-illustration {
    font-size: 54px;
    margin-bottom: 20px;
}

.modal-card h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.modal-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-block {
    width: 100%;
}

/* ─── Premium Multi-Step Wizard Styling ────────────────────────────────────── */
.step-indicator-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(229, 231, 235, 0.7);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 8px;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--border-color);
    z-index: 1;
}

.step-progress-line {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-color);
    z-index: 2;
    width: 0%;
    transition: width 0.4s ease;
}

body.ltr .step-progress-line {
    left: 0;
    right: auto;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    position: relative;
    z-index: 3;
    transition: all 0.3s ease;
}

.step-dot.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-light);
    transform: scale(1.1);
}

.step-dot.completed {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #ffffff;
}

.step-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0 4px;
}

.step-label {
    text-align: center;
    width: 60px;
    transition: color 0.3s ease;
}

.step-label.active {
    color: var(--primary-color);
}

/* Step Panels Navigation */
.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
    animation: stepSlideIn 0.35s ease-out;
}

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

.step-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}

.btn-nav-prev {
    background-color: #ffffff;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 24px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-nav-prev:hover {
    background-color: #f9fafb;
    border-color: var(--text-secondary);
}

.btn-nav-next {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 14px 24px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.15);
}

.btn-nav-next:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.2);
}

/* Biometric Group Sections */
.bio-group-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 24px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info Icon and Triggers */
.info-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 6px;
    vertical-align: middle;
    transition: all 0.2s ease;
}

body.ltr .info-trigger {
    margin-right: 0;
    margin-left: 6px;
}

.info-trigger:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Info Modal Dialog */
.info-modal-card {
    background-color: #ffffff;
    max-width: 440px;
    width: 100%;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: modalSlideUp 0.3s ease-out;
}

.info-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.info-modal-header .icon {
    font-size: 24px;
}

.info-modal-header h3 {
    font-size: 14px;
    font-weight: 800;
}

.info-modal-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.btn-modal-close {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    margin-top: 18px;
    transition: background-color 0.2s;
}

.btn-modal-close:hover {
    background-color: var(--primary-hover);
}

/* Summary Panel for review */
.summary-panel {
    background-color: var(--primary-light);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(13, 148, 136, 0.1);
    margin-bottom: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(13, 148, 136, 0.15);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item span:first-child {
    font-weight: 700;
    color: var(--text-primary);
}

.summary-item span:last-child {
    color: var(--text-secondary);
}

/* ─── Visual Validation States ────────────────────────────────────────────── */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
    animation: shakeInput 0.35s ease;
}

.form-group.has-error label {
    color: var(--error);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--error);
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    padding: 0 4px;
    animation: fadeSlideDown 0.25s ease-out;
}

.error-message .error-icon {
    font-size: 12px;
    flex-shrink: 0;
}

@keyframes shakeInput {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

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

/* Required field star */
.required-star {
    color: var(--error);
    font-weight: 800;
    margin-right: 2px;
    font-size: 13px;
}

body.ltr .required-star {
    margin-right: 0;
    margin-left: 2px;
}

/* Unit badge next to input fields */
.input-with-unit {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-with-unit input {
    flex: 1;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

body.ltr .input-with-unit input {
    border-top-left-radius: 14px !important;
    border-bottom-left-radius: 14px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.unit-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
    border: 1.5px solid var(--border-color);
    border-right: none;
    border-radius: 14px 0 0 14px;
    min-width: 48px;
    white-space: nowrap;
    user-select: none;
}

body.ltr .unit-badge {
    border-right: 1.5px solid var(--border-color);
    border-left: none;
    border-radius: 0 14px 14px 0;
}

.form-group.has-error .unit-badge {
    border-color: var(--error);
    color: var(--error);
    background-color: #fef2f2;
}

.form-group.has-error .input-with-unit input {
    border-color: var(--error) !important;
}

/* Warn state (value out of range but not blocking) */
.form-group.has-warning input {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1) !important;
}

.warning-message {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #d97706;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    padding: 0 4px;
    animation: fadeSlideDown 0.25s ease-out;
}

/* File drop zone error */
.file-drop-zone.has-error {
    border-color: var(--error) !important;
    background-color: #fef2f2 !important;
    color: var(--error) !important;
}

/* ─── Toggle Switch (iOS-style slide toggle) ─────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.toggle-row .toggle-label {
    margin-bottom: 0;
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.toggle-row .toggle-label .info-trigger {
    margin-inline-start: 4px; /* تحسين التباعد لأيقونة المعلومات */
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    border-radius: 26px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

body.ltr .toggle-slider::before {
    left: auto;
    right: 3px;
}

body.ltr .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(-22px);
}

/* Toggle sub-panel that slides down */
.toggle-sub-panel {
    display: none;
    padding: 12px 0 4px 0;
    animation: fadeSlideDown 0.25s ease-out;
}

.toggle-sub-panel.active {
    display: block;
}

/* ─── Severity Pill Selector ─────────────────────────────────────────────── */
.severity-selector {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.severity-pill {
    flex: 1;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.severity-pill .severity-icon {
    font-size: 18px;
}

.severity-pill:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.severity-pill.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2);
}

.severity-pill.selected .severity-icon {
    filter: grayscale(0);
}

.severity-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-bottom: 4px;
}

/* ─── Collapsible Bio Group Accordion ────────────────────────────────────── */
.bio-accordion {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.bio-accordion.has-error {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.bio-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.bio-accordion-header:hover {
    background-color: var(--primary-light);
}

.bio-accordion.active .bio-accordion-header {
    border-bottom-color: var(--border-color);
    background-color: var(--primary-light);
}

.bio-accordion-title {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bio-accordion-badge {
    font-size: 10px;
    font-weight: 700;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(13, 148, 136, 0.15);
}

.bio-accordion.has-error .bio-accordion-badge {
    background-color: #fef2f2;
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.2);
}

.bio-accordion-arrow {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.25s ease;
}

.bio-accordion.active .bio-accordion-arrow {
    transform: rotate(180deg);
}

.bio-accordion-body {
    display: none;
    padding: 16px 18px;
    animation: fadeSlideDown 0.25s ease-out;
}

.bio-accordion.active .bio-accordion-body {
    display: block;
}

.bio-accordion-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.btn-bio-next {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-bio-next:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* ─── Pregnancy/Lactation Info Panel ─────────────────────────────────────── */
.date-info-panel {
    background-color: var(--primary-light);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 10px;
    border: 1px solid rgba(13, 148, 136, 0.1);
}

.date-info-panel .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
}

.date-info-panel .info-row .info-label {
    font-weight: 700;
    color: var(--text-primary);
}

.date-info-panel .info-row .info-value {
    font-weight: 800;
    color: var(--primary-color);
}

.date-note {
    font-size: 10.5px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.5;
    font-style: italic;
}

/* Date input within toggle panel */
.toggle-sub-panel .form-group {
    margin-bottom: 8px;
}

.toggle-sub-panel input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    font-family: inherit;
    font-size: 13px;
    background-color: #ffffff;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.toggle-sub-panel input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

