/* register-main.css - النسخة النهائية والمنظمة */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --input-text-color: #000000;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 5px 20px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

/* إعادة ضبط الأساسيات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.mobile-device {
    touch-action: manipulation;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* تحسينات الهيدر */
.register-header {
    background: linear-gradient(135deg, var(--primary-color), #1a2530);
    color: white !important;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.register-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: cover;
}

.register-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    position: relative;
    color: white !important;
}

.register-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    color: white !important;
}

/* قسم الحاوية الرئيسية */
.register-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

/* قسم عرض السيارة */
.car-summary {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 20px;
    transition: var(--transition);
}

.car-summary-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-bg);
    font-size: 1.8rem;
}

.mobile-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.car-image-container {
    margin-bottom: 20px;
}

.car-image {
    width: 100%;
    height: 250px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f5f5f5;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.car-image:hover img {
    transform: scale(1.05);
}

.car-title {
    color: var(--primary-color);
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* تفاصيل السيارة */
.car-details-collapsible {
    display: block;
    transition: var(--transition);
}

.car-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.detail-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.detail-card:hover {
    background: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.detail-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.detail-content {
    flex: 1;
}

.detail-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.detail-value {
    display: block;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* السعر */
.car-price {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: 700;
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    background: linear-gradient(135deg, #fff5f5, #ffeaea);
    border-radius: 10px;
    transition: var(--transition);
}

.car-price:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* أزرار قسم السيارة */
.car-summary-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--light-bg);
}

.btn-back {
    flex: 1;
    background: #f8f9fa;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
    min-height: 44px;
}

.btn-back:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: var(--primary-color);
}

.btn-view-details {
    display: none;
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn-view-details:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* قسم النموذج */
.form-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.form-header {
    margin-bottom: 30px;
    text-align: center;
}

.form-section h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.form-subtitle {
    color: #666;
    font-size: 1rem;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    margin: 25px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-bg);
    font-size: 1.2rem;
}

.form-section-title i {
    color: var(--secondary-color);
}

/* حقول الإدخال */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
    user-select: none;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    color: var(--input-text-color);
    background: white;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    color: var(--input-text-color);
}

/* جعل placeholder رمادي */
.form-group input::placeholder,
.form-group textarea::placeholder,
.form-group select option:disabled {
    color: #666;
    opacity: 1;
}

.form-group input:-ms-input-placeholder,
.form-group textarea:-ms-input-placeholder {
    color: #666;
}

.form-group input::-ms-input-placeholder,
.form-group textarea::-ms-input-placeholder {
    color: #666;
}

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

.required {
    color: var(--accent-color);
}

.hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

/* تحسينات select */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232c3e50' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 16px;
    padding-left: 40px !important;
    cursor: pointer;
}

/* مجموعة الخصوصية */
.privacy-group {
    margin-top: 25px;
}

.privacy-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.privacy-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.privacy-label {
    flex: 1;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: normal !important;
}

.privacy-text {
    line-height: 1.5;
    color: var(--primary-color);
}

.privacy-text a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

.privacy-text a:hover {
    text-decoration: underline;
}

/* أزرار النموذج */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--light-bg);
}

.btn-submit {
    flex: 1;
    background: linear-gradient(135deg, var(--success-color), #219653);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    touch-action: manipulation;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #219653, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

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

/* قسم المعلومات الإضافية */
.info-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-top: 40px;
    margin-bottom: 60px;
}

.info-section h3 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.info-card:hover {
    background: white;
    border-color: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-sm);
}

.info-card i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.info-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* رسائل التنبيه */
#alertContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    z-index: 1000;
    max-width: 500px;
    margin: 0 auto;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: none;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(212, 237, 218, 0.95);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: rgba(248, 215, 218, 0.95);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.alert-text {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    margin-right: auto;
    font-size: 1rem;
    opacity: 0.7;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

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

/* حالة التحميل */
.loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 15px;
}

.loading i {
    font-size: 2rem;
    color: var(--secondary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading p {
    color: var(--primary-color);
    font-size: 1.1rem;
}

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

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

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