/**
 * Checkout Page Styles
 * Unified Design for Service and Package Checkout Pages
 * Phoenix IT - Modern & Secure Design
 */

/* ============================================
   GLOBAL STYLES
   ============================================ */
body.checkout-page {
    background: linear-gradient(135deg, #f0fdf4 0%, #e7f5ff 50%, #fef3f2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* التأكد من أن الـ header الأصلي لا يتأثر - إزالة جميع القواعد التي تغيره */
body.checkout-page .main-content {
    width: 100%;
    max-width: 100%;
}

body.checkout-page .checkout-container * {
    box-sizing: border-box;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.checkout-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 2rem 2rem;
    position: relative;
    box-sizing: border-box;
}

/* ============================================
   HEADER SECTION
   ============================================ */
.checkout-header {
    background: linear-gradient(135deg, #00A887 0%, #059669 100%);
    border-radius: 20px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 168, 135, 0.2);
}

.checkout-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.checkout-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 0;
}

.checkout-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.checkout-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.checkout-header h1 i {
    font-size: 2.25rem;
    animation: icon-float 3s ease-in-out infinite;
}

.checkout-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    margin: 0;
}

/* ============================================
   STEPS INDICATOR
   ============================================ */
.checkout-steps-wrapper {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 168, 135, 0.1);
}

.checkout-steps {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem;
    flex-wrap: nowrap;
    position: relative;
    overflow-x: auto;
    padding: 0;
}

.checkout-steps::-webkit-scrollbar {
    height: 4px;
}

.checkout-steps::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.checkout-steps::-webkit-scrollbar-thumb {
    background: #00A887;
    border-radius: 2px;
}

.step {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: default;
    flex: 1;
    justify-content: flex-start;
}

.step:hover {
    background: rgba(0, 168, 135, 0.03);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.step-number::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #00A887, #059669);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step.active .step-number {
    background: linear-gradient(135deg, #00A887 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 168, 135, 0.4);
    transform: scale(1.05);
    border-color: rgba(0, 168, 135, 0.3);
}

@keyframes step-pulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(0, 168, 135, 0.4);
    }
    50% { 
        box-shadow: 0 8px 35px rgba(0, 168, 135, 0.6);
    }
}

.step.active .step-number::before {
    opacity: 1;
}

.step.completed .step-number {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.step.completed .step-number::after {
    content: '✓';
    position: absolute;
    font-size: 1.2rem;
    font-weight: 900;
}

/* RTL/LTR Support */
html[dir="rtl"] .checkout-page .step-label,
html[dir="rtl"] .step-label {
    text-align: right;
}

html[dir="ltr"] .checkout-page .step-label,
html[dir="ltr"] .step-label {
    text-align: left;
}

.step-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: normal;
    margin-top: 0;
    line-height: 1.5;
    flex: 1;
    word-wrap: break-word;
}

.step.active .step-label {
    color: #00A887;
    font-size: 1rem;
    font-weight: 800;
}

.step.completed .step-label {
    color: #28a745;
}

.step-connector {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
    margin: 0 0.5rem;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    flex-shrink: 0;
}

.step-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.completed ~ .step-connector::after {
    width: 100%;
}

.step.completed ~ .step-connector {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

/* ============================================
   CONTENT GRID
   ============================================ */
.checkout-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .checkout-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FORM CARD
   ============================================ */
.checkout-form-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 168, 135, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.checkout-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #00A887 0%, #059669 100%);
}

.checkout-form-card:hover {
    box-shadow: 0 15px 50px rgba(0, 168, 135, 0.15);
    transform: translateY(-2px);
    border-color: rgba(0, 168, 135, 0.2);
}

/* ============================================
   REGISTRATION HEADER
   ============================================ */
.registration-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid #f0f0f0;
    position: relative;
}

.registration-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #00A887 0%, #059669 100%);
    border-radius: 3px;
}

.registration-header h3 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #00A887 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    letter-spacing: -0.5px;
}

.registration-header h3 i {
    background: linear-gradient(135deg, #00A887 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.25rem;
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.registration-header p {
    color: #64748b;
    font-size: 1.05rem;
    margin: 0;
    font-weight: 500;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group-enhanced {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group-enhanced label {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: block;
}

.form-group-enhanced .form-control,
.form-group-enhanced .form-select {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #f8fafc;
    color: #1e293b;
    width: 100%;
}

.form-group-enhanced .form-control:hover,
.form-group-enhanced .form-select:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.form-group-enhanced .form-control:focus,
.form-group-enhanced .form-select:focus {
    border-color: #00A887;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(0, 168, 135, 0.1), 0 4px 12px rgba(0, 168, 135, 0.15);
    outline: none;
    transform: translateY(-1px);
}

.form-group-enhanced .label-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-group-enhanced .label-icon i {
    color: #00A887;
    font-size: 1rem;
}

.form-group-enhanced .form-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    display: block;
}

/* ============================================
   PASSWORD STRENGTH
   ============================================ */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: #dc3545;
}

.password-strength-bar.medium {
    width: 66%;
    background: #ffc107;
}

.password-strength-bar.strong {
    width: 100%;
    background: #28a745;
}

/* ============================================
   TERMS CHECKBOX
   ============================================ */
.terms-checkbox {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.terms-checkbox:hover {
    border-color: #00A887;
    background: #f0fdf4;
}

.terms-checkbox .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.25rem;
    cursor: pointer;
    border: 2px solid #6c757d;
    transition: all 0.3s ease;
}

.terms-checkbox .form-check-input:checked {
    background-color: #00A887;
    border-color: #00A887;
}

.terms-checkbox .form-check-label {
    margin-right: 0.5rem;
    cursor: pointer;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.6;
}

.terms-checkbox .form-check-label a {
    color: #00A887;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    cursor: pointer;
}

.terms-checkbox .form-check-label a:hover {
    color: #059669;
    text-decoration: underline;
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #00A887 0%, #059669 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 1.5rem;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.9;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body h6 {
    color: #00A887;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.modal-body h6:first-child {
    margin-top: 0;
}

.modal-body p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    border-radius: 0 0 15px 15px;
}

.modal-footer .btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.modal-footer .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-register,
.btn-submit {
    background: linear-gradient(135deg, #00A887 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    padding: 1.125rem 2rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 168, 135, 0.3);
    width: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn-register::before,
.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-register:hover::before,
.btn-submit:hover::before {
    width: 300px;
    height: 300px;
}

.btn-register:hover,
.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 168, 135, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.btn-register:active,
.btn-submit:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 168, 135, 0.3);
}

.btn-register:disabled,
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-back {
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   REGISTRATION BENEFITS
   ============================================ */
.registration-benefits {
    background: linear-gradient(135deg, #f0fdf4 0%, #e7f5ff 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-right: 4px solid #00A887;
}

.registration-benefits h6 {
    color: #00A887;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.registration-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.registration-benefits ul li {
    padding: 0.5rem 0;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.registration-benefits ul li i {
    color: #28a745;
    font-size: 0.9rem;
}

/* ============================================
   SUMMARY CARD
   ============================================ */
.checkout-summary-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 2rem;
    height: fit-content;
    border: 2px solid rgba(0, 168, 135, 0.1);
    transition: all 0.3s ease;
}

.checkout-summary-card:hover {
    box-shadow: 0 15px 50px rgba(0, 168, 135, 0.15);
    transform: translateY(-2px);
    border-color: rgba(0, 168, 135, 0.2);
}

.summary-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.summary-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00A887;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.summary-header h3 i {
    font-size: 1.25rem;
}

.service-summary {
    text-align: center;
    padding: 1.5rem 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 1.5rem;
}

.service-icon-wrapper {
    margin-bottom: 1rem;
    background: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.service-summary .service-icon {
    font-size: 3.5rem;
    color: #00A887 !important;
    display: inline-block !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    position: relative;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.service-summary .service-icon::before,
.service-summary .service-icon::after {
    display: none !important;
    content: none !important;
}

.service-summary .service-icon i {
    color: #00A887 !important;
    font-size: 3.5rem !important;
}

.service-summary h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.service-type {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.summary-details {
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

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

.summary-label {
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-label i {
    color: #00A887;
    font-size: 0.9rem;
}

.summary-value {
    color: #1e293b;
    font-weight: 600;
}

.summary-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.summary-info-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #e7f5ff 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border-right: 4px solid #00A887;
}

.info-box-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-box-header i {
    color: #00A887;
    font-size: 1.1rem;
}

.info-box-header h6 {
    color: #00A887;
    font-weight: 700;
    margin: 0;
    font-size: 1rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.75rem 0;
    color: #1e293b;
    display: flex;
    align-items: start;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-list li i {
    color: #28a745;
    font-size: 0.9rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* ============================================
   TABS STYLING
   ============================================ */
.auth-tabs-wrapper {
    margin-bottom: 2rem;
    width: 100%;
}

.nav-tabs {
    border-bottom: 3px solid #e2e8f0;
    display: flex;
    gap: 0;
    margin-bottom: 0;
    width: 100%;
    list-style: none;
    padding: 0;
}

.nav-tabs .nav-item {
    flex: 1;
    min-width: 0;
}

.nav-tabs .nav-link {
    position: relative;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    color: #64748b;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    box-sizing: border-box;
    min-width: 0;
    flex: 1 1 0;
}

.nav-tabs .nav-link span {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    display: inline-block;
}

.nav-tabs .nav-link i {
    font-size: 1rem;
    flex-shrink: 0;
    display: inline-block;
}

.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00A887 0%, #059669 100%);
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-tabs .nav-link.active {
    color: #00A887 !important;
    background: rgba(0, 168, 135, 0.05) !important;
}

.nav-tabs .nav-link.active::after {
    opacity: 1;
}

.nav-tabs .nav-link:hover:not(.active) {
    color: #00A887 !important;
    background: rgba(0, 168, 135, 0.03) !important;
}

/* Tab Content Styling - إلغاء تأثير phoenix.css */
.tab-content,
.checkout-page .tab-content,
body.checkout-page .tab-content,
#authTabsContent {
    display: block !important;
    width: 100% !important;
    min-height: 400px !important;
    padding-top: 1rem !important;
    position: relative !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* استخدام namespace للتبويبات */
.checkout-page .tab-content .tab-pane {
    overflow: visible;
}

.checkout-page .tab-content .tab-pane.show.active,
.checkout-page .tab-content .tab-pane.show,
.checkout-page .tab-content .tab-pane.active {
    overflow: visible;
    height: auto;
    min-height: 0;
    display: block;
    opacity: 1;
    visibility: visible;
}

/* التأكد من أن المحتوى داخل التبويبات يظهر */
.tab-pane.show.active form,
.tab-pane.show.active .form-group-enhanced,
.tab-pane.show.active .registration-header,
.tab-pane.show.active .registration-benefits,
#login.show.active form,
#login.show.active .form-group-enhanced,
#login.show form,
#login.active form {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* جميع التبويبات - افتراضياً مخفية - استخدام namespace */
.checkout-page .tab-pane {
    display: none;
    width: 100%;
    opacity: 0;
    visibility: hidden;
}

.checkout-page .tab-pane.show,
.checkout-page .tab-pane.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* استثناء: #login يجب أن يظهر دائماً عند التحميل - أولوية قصوى */
#login {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    position: relative !important;
}

/* التأكد من أن جميع العناصر داخل #login مرئية - أولوية قصوى */
#login * {
    visibility: visible !important;
    opacity: 1 !important;
}

#login form {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    position: relative !important;
}

#login .form-group-enhanced {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    margin-bottom: 1.5rem !important;
    position: relative !important;
}

#login input,
#login label,
#login button,
#login .form-control,
#login .label-icon {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    position: relative !important;
}

#login .label-icon {
    display: inline-flex !important;
}

/* التبويبات النشطة يجب أن تظهر */
.tab-pane.show.active,
.tab-pane.show,
.tab-pane.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

/* استثناء خاص لـ #login - يجب أن يظهر فقط عندما يكون نشطاً */
#login.show.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

/* #login بدون show.active يجب أن يكون مخفياً */
#login:not(.show.active) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* التأكد من أن #register يظهر عند تفعيله */
#register.show.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

/* #register بدون show.active يجب أن يكون مخفياً */
#register:not(.show.active) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* التأكد من أن جميع العناصر داخل التبويبات النشطة مرئية */
.tab-pane.show.active {
    visibility: visible !important;
    opacity: 1 !important;
}

.tab-pane.show.active form {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tab-pane.show.active .form-group-enhanced {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tab-pane.show.active .registration-header,
.tab-pane.show.active .registration-benefits {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tab-pane.show.active input,
.tab-pane.show.active label,
.tab-pane.show.active button,
.tab-pane.show.active select,
.tab-pane.show.active textarea {
    visibility: visible !important;
    opacity: 1 !important;
}

/* التأكد من أن Bootstrap grid يعمل بشكل صحيح */
.tab-pane.show.active .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-right: -15px !important;
    margin-left: -15px !important;
}

.tab-pane.show.active .col-md-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
    position: relative !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    .tab-pane.show.active .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* التأكد من أن #login يظهر عندما يكون نشطاً */
#login.show,
#login.active,
#login.show.active,
#login.fade.show.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#login form,
#login .form-group-enhanced,
#login .form-control,
#login .btn-register,
#login input,
#login label,
#login button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#login .form-group-enhanced {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 1.5rem !important;
}

#login .form-group-enhanced label,
#login .form-group-enhanced .label-icon {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#login .form-group-enhanced .form-control {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
}

/* التبويب النشط يجب أن يظهر دائماً - أولوية قصوى */
.tab-pane.show.active,
.tab-pane.fade.show.active {
    display: block !important;
    width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 1 !important;
    height: auto !important;
    min-height: 0 !important;
}

/* التأكد من أن التبويب #login يظهر دائماً إذا كان لديه class show أو active */
#login.show,
#login.active,
#login.fade.show,
#login.fade.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tab-pane.fade {
    transition: opacity 0.15s linear, visibility 0.15s linear;
}

.tab-pane.fade:not(.show):not(.active) {
    opacity: 0;
    visibility: hidden;
}

.tab-pane.fade.show,
.tab-pane.fade.active {
    opacity: 1;
    visibility: visible;
}

/* التأكد من أن التبويبات غير النشطة مخفية */
.tab-pane:not(.show):not(.active) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* استثناء خاص لـ #login إذا كان لديه show أو active */
#login.show,
#login.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ============================================
   ALERTS
   ============================================ */
.checkout-alert {
    border-radius: 12px;
    border-right: 4px solid;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.alert-content i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

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

.alert-success {
    background-color: #f0fdf4;
    border-color: #28a745;
    color: #166534;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #dc3545;
    color: #991b1b;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #0dcaf0;
    color: #0c5460;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large Desktop (1400px and above) */
@media (min-width: 1400px) {
    .checkout-container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .nav-tabs .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .checkout-container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .nav-tabs .nav-link {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Tablet Landscape / Small Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .checkout-container {
        padding: 2rem 1.5rem;
    }
    
    .checkout-header {
        padding: 2.5rem 1.5rem;
    }
    
    .checkout-header h1 {
        font-size: 2.25rem;
    }
    
    .nav-tabs .nav-link {
        padding: 1rem 1rem;
        font-size: 0.95rem;
    }
}

/* Tablet Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .checkout-container {
        padding: 1.5rem 1rem;
    }
    
    .checkout-header {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .checkout-header h1 {
        font-size: 2rem;
    }
    
    .checkout-header h1 i {
        font-size: 1.75rem;
    }
    
    .checkout-steps-wrapper {
        padding: 1.5rem;
    }
    
    .checkout-form-card,
    .checkout-summary-card {
        padding: 2rem;
    }
    
    .registration-header h3 {
        font-size: 1.75rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.875rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Mobile Landscape / Small Tablet (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .checkout-container {
        padding: 1.5rem 1rem;
    }
    
    body.checkout-page .checkout-container {
        padding: 1rem;
    }
    
    .checkout-header {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: 15px;
    }
    
    .checkout-header h1 {
        font-size: 1.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .checkout-header h1 i {
        font-size: 1.5rem;
    }
    
    .checkout-subtitle {
        font-size: 1rem;
    }
    
    .checkout-steps-wrapper {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .checkout-steps {
        gap: 0.5rem;
        padding: 1rem 0;
        flex-wrap: wrap;
    }
    
    .step {
        min-width: 100px;
    }
    
    .step-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .step-label {
        font-size: 0.8rem;
        min-width: 90px;
    }
    
    .step-connector {
        width: 30px;
    }
    
    .checkout-form-card,
    .checkout-summary-card {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .checkout-summary-card {
        position: static;
        margin-top: 2rem;
    }
    
    .registration-header h3 {
        font-size: 1.5rem;
    }
    
    .registration-header p {
        font-size: 0.95rem;
    }
    
    .btn-register,
    .btn-submit {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Mobile Portrait (up to 575px) */
@media (max-width: 575px) {
    .checkout-container {
        padding: 1rem 0.75rem;
    }
    
    body.checkout-page .checkout-container {
        padding: 0.75rem;
    }
    
    .checkout-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }
    
    .checkout-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .checkout-header h1 i {
        font-size: 1.25rem;
    }
    
    .checkout-subtitle {
        font-size: 0.9rem;
    }
    
    .checkout-steps-wrapper {
        padding: 1rem 0.75rem;
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }
    
    .checkout-steps {
        gap: 0.25rem;
        padding: 0.75rem 0;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .step {
        min-width: 80px;
        padding: 0.25rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-label {
        font-size: 0.75rem;
        min-width: 80px;
        max-width: 80px;
        white-space: normal;
        line-height: 1.2;
    }
    
    .step-connector {
        width: 20px;
        height: 2px;
    }
    
    .checkout-content {
        gap: 1.5rem;
    }
    
    .checkout-form-card,
    .checkout-summary-card {
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .checkout-summary-card {
        position: static;
        margin-top: 1.5rem;
    }
    
    .registration-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .registration-header h3 {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .registration-header h3 i {
        font-size: 1.1rem;
    }
    
    .registration-header p {
        font-size: 0.85rem;
    }
    
    .registration-benefits {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .registration-benefits h6 {
        font-size: 0.95rem;
    }
    
    .registration-benefits ul li {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }
    
    .form-group-enhanced {
        margin-bottom: 1.25rem;
    }
    
    .form-group-enhanced label {
        font-size: 0.9rem;
    }
    
    .form-group-enhanced .form-control,
    .form-group-enhanced .form-select {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .btn-register,
    .btn-submit {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .nav-tabs {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .nav-tabs .nav-link::after {
        display: none;
    }
    
    .tab-content {
        min-height: 0;
        padding-top: 0.5rem;
    }
    
    .checkout-summary-card .service-icon {
        font-size: 2.5rem;
    }
    
    .summary-header h3 {
        font-size: 1.25rem;
    }
    
    .summary-item {
        padding: 0.75rem 0;
        font-size: 0.85rem;
    }
    
    .summary-info-box {
        padding: 1rem;
    }
    
    .info-list li {
        font-size: 0.8rem;
        padding: 0.5rem 0;
    }
}

/* ============================================
   SECURITY & ACCESSIBILITY
   ============================================ */
.form-control:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
}

.form-control:valid:not(:focus):not(:placeholder-shown) {
    border-color: #28a745;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #00A887;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   FIX: التأكد من ظهور التبويبات النشطة
   ============================================ */
/* إلغاء تأثير phoenix.css الذي يخفي .tab-content */
.checkout-page .tab-content,
body.checkout-page .tab-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* قاعدة قوية جداً لضمان ظهور #login عندما يكون نشطاً */
div#login.tab-pane.fade.show.active,
div#login.tab-pane.show.active,
div#login.tab-pane.active,
div#login.show,
div#login.active,
#login {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* التأكد من ظهور #register عندما يكون نشطاً */
div#register.tab-pane.fade.show.active,
div#register.tab-pane.show.active,
div#register.tab-pane.active,
div#register.show,
div#register.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* التأكد من أن جميع العناصر داخل التبويبات النشطة مرئية */
div#login.show.active *,
div#login.active *,
div#register.show.active *,
div#register.active * {
    visibility: visible !important;
    opacity: 1 !important;
}

div#login.show.active form,
div#login.active form,
div#login form,
div#register.show.active form,
div#register.active form {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    position: relative !important;
}

/* قاعدة نهائية قوية جداً - يجب أن تكون في النهاية */
/* إلغاء تأثير phoenix.css */
.checkout-page #login,
body.checkout-page #login,
#login {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

.checkout-page #login form,
.checkout-page #login #loginForm,
body.checkout-page #login form,
body.checkout-page #login #loginForm,
#login form,
#login #loginForm {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    position: relative !important;
}

.checkout-page #login .form-group-enhanced,
.checkout-page #login form .form-group-enhanced,
body.checkout-page #login .form-group-enhanced,
body.checkout-page #login form .form-group-enhanced,
#login .form-group-enhanced,
#login form .form-group-enhanced {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    margin-bottom: 1.5rem !important;
    position: relative !important;
}

.checkout-page #login input,
.checkout-page #login label,
.checkout-page #login button,
.checkout-page #login .form-control,
body.checkout-page #login input,
body.checkout-page #login label,
body.checkout-page #login button,
body.checkout-page #login .form-control,
#login input,
#login label,
#login button,
#login .form-control {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

.checkout-page #login .label-icon,
body.checkout-page #login .label-icon,
#login .label-icon {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}


