/* ========================================
   Customer Registration Styles
   ======================================== */

.customer-register-container {
    min-height: 100vh;
    padding: 40px 0;
    padding-top: clamp(5.75rem, 12vw + 2.5rem, 8.5rem);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.register-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* Progress Bar */
.progress-section {
    margin-bottom: 40px;
    padding-top: 0.5rem;
}

.progress-bar-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    border: 3px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: #007bff;
    border-color: #0056b3;
    color: white;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.4);
}

.progress-step.completed .step-circle {
    background: #28a745;
    border-color: #1e7e34;
    color: white;
}

.step-label {
    font-size: 14px;
    color: #495057;
    font-weight: 600;
    text-align: center;
}

.progress-line {
    flex: 1;
    height: 3px;
    background: #dee2e6;
    margin: 0 15px;
    margin-top: 25px;
    transition: all 0.3s ease;
}

.progress-line.active {
    background: #28a745;
}

/* Register Header */
.register-header {
    text-align: center;
    margin-bottom: 40px;
}

.register-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.register-header p {
    font-size: 16px;
    color: #666;
}

/* Form Container */
.register-form-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: #007bff;
    border-radius: 2px;
    margin-right: 10px;
}

/* Form Labels */
.form-label {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background-color: #fff;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.file-upload-area:hover {
    border-color: #007bff;
    background: #f0f7ff;
}

.file-upload-area input[type="file"] {
    display: none;
}

.file-upload-text {
    color: #666;
}

.file-upload-text i {
    font-size: 32px;
    color: #007bff;
    margin-bottom: 10px;
}

.file-upload-text p {
    margin: 10px 0;
    font-weight: 600;
}

.file-upload-text small {
    display: block;
    margin-top: 5px;
}

/* Image Preview */
#passportImagePreview {
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    text-align: center;
}

#passportImagePreview img {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ====== خيارات التقاط جواز السفر (كاميرا + رفع) ====== */

.passport-capture-options .btn {
    min-width: 150px;
}

/* ويدجت الكاميرا */
.camera-widget {
    border: 2px solid #007bff;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    position: relative;
}

.camera-video-wrap {
    position: relative;
    width: 100%;
    max-height: 360px;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-video-wrap video {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
    transform: scaleX(-1); /* عكس الصورة الأمامية */
}

/* إطار إرشادي فوق الفيديو */
.camera-guide-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.camera-guide-frame {
    width: 72%;
    height: 68%;
    border: 3px dashed rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.25);
}

.camera-guide-hint {
    color: #fff;
    font-size: 0.82rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 10px;
}

.camera-actions {
    background: #1a1a1a;
    padding: 0.75rem 1rem;
}

/* معاينة الصورة */
.passport-preview img {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
    padding: 6px;
}

@media (max-width: 576px) {
    .passport-capture-options .btn {
        flex: 1 1 100%;
    }

    .camera-guide-frame {
        width: 88%;
        height: 65%;
    }
}

/* Terms modal — RTL عربي + أكورديون تفاعلي */
.terms-modal-rtl {
    direction: rtl;
    text-align: right;
}

.terms-modal-rtl .modal-header .btn-close {
    margin-inline-start: auto;
    margin-inline-end: 0;
}

.terms-intro {
    font-size: 0.95rem;
}

.terms-legal-accordion {
    --terms-acc-radius: 0;
}

.terms-legal-accordion .accordion-item {
    background: transparent;
}

.terms-legal-accordion .accordion-button {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
    box-shadow: none !important;
    align-items: center;
}

.terms-legal-accordion .accordion-button:not(.collapsed) {
    background: rgba(0, 123, 255, 0.08);
    color: #0d47a1;
}

.terms-legal-accordion .accordion-button.collapsed {
    background: #fff;
}

.terms-legal-accordion .accordion-body {
    font-size: 0.92rem;
    line-height: 1.85;
    padding: 1rem 1.15rem 1.25rem;
    background: #fafbfc;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.terms-legal-accordion .terms-list {
    margin: 0;
    padding-inline-start: 1.35rem;
}

.terms-legal-accordion .terms-list li {
    margin-bottom: 0.35rem;
}

.terms-acc-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.12);
    color: #0056b3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1;
}

.terms-acc-num--accent {
    background: rgba(25, 135, 84, 0.15);
    color: #146c43;
}

.terms-acc-title {
    text-align: start;
    flex: 1;
}

.terms-acc-ack-header .accordion-button:not(.collapsed) {
    background: rgba(25, 135, 84, 0.1);
    color: #0f5132;
}

.terms-ack-body {
    background: rgba(25, 135, 84, 0.06) !important;
    border-inline-start: 3px solid #198754;
}

@media (max-width: 576px) {
    .terms-legal-accordion .accordion-button {
        font-size: 0.88rem;
        padding: 0.75rem 0.85rem;
    }

    .terms-acc-num {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.8rem;
    }
}

.register-form-container .form-section .d-flex > .form-check-input {
    margin-right: 0;
    margin-left: 0;
}

/* Form Check */
.form-check {
    padding-left: 0;
    margin-bottom: 20px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 4px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

.form-check-label a {
    text-decoration: none;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background: #007bff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.3);
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

/* Error Feedback */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
}

/* Alert */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-danger .alert-heading {
    color: #721c24;
}

/* Bottom Text */
.register-form-container .text-center {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.text-center a {
    text-decoration: none;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .customer-register-container {
        padding-top: clamp(5.5rem, 11vw + 3rem, 8rem);
    }

    .register-wrapper {
        padding: 0 20px;
    }

    .register-form-container {
        padding: 20px;
    }

    .register-header h1 {
        font-size: 24px;
    }

    .progress-line {
        display: none;
    }

    .progress-bar-custom {
        flex-direction: column;
        gap: 20px;
    }

    .progress-step {
        width: 100%;
    }

    .row > .col-md-6 {
        margin-bottom: 15px;
    }
}

/* Terms agreement */
.terms-agreement-section--error .terms-agreement-box {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.terms-agreement-box {
    width: 100%;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    min-height: 10.5rem;
    background: #f8f9fa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.terms-agreement-box--accepted {
    border-color: #198754;
    background: #e8f7ee;
    padding: 2rem 2.25rem;
    min-height: 11rem;
}

.terms-agreement-box--highlight {
    animation: terms-agreement-pulse 0.6s ease 2;
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

@keyframes terms-agreement-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.terms-agreement-section__title {
    margin-bottom: 1rem;
}

.terms-agreement-check {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem 0;
}

.terms-agreement-check .form-check-input {
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid #000;
    background-color: #fff;
    box-shadow: none;
}

.terms-agreement-check .form-check-input:focus {
    border-color: #000;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.2);
}

.terms-agreement-check .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #000;
}

.terms-agreement-check .form-check-input.is-invalid {
    border-color: #dc3545;
}

.terms-agreement-check .form-check-label {
    cursor: pointer;
    line-height: 1.75;
    font-weight: 500;
    padding: 0.15rem 0;
}

.terms-agreement-check__required {
    color: #dc3545;
    margin-inline-end: 0.15rem;
}

.terms-agreement-check__ack {
    color: #0d6efd;
    font-size: 1.05em;
    margin-inline-end: 0.25rem;
}

.terms-agreement-view-btn {
    margin-bottom: 1rem;
}

.terms-agreement-hint {
    font-size: 0.9rem;
    color: #6c757d;
    padding-top: 0.25rem;
    line-height: 1.6;
}

#registrationSubmitBtn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Helper Text */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 13px;
}

/* Transitions */
.form-control,
.btn {
    transition: all 0.3s ease;
}

/* Focus Styles */
:focus-visible {
    outline: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
