/* استيراد الخط العربي */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

:root {
    --primary-color: #3182ce;
    --primary-hover: #2b6cb0;
    --primary-light: #ebf8ff;
    --error-color: #e53e3e;
    --success-color: #38a169;
    --text-color: #2d3748;
    --text-light: #718096;
    --light-gray: #f7fafc;
    --border-color: #e2e8f0;
    --input-bg: #f8fafc;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    background-color: #f0f2f5;
    background-image: linear-gradient(135deg, #f0f2f5 0%, #e6f2ff 100%);
    color: var(--text-color);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
}

.form-container {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    padding: 40px;
    max-width: 550px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

    .form-container::before {
        content: "";
        position: absolute;
        top: -50px;
        right: -50px;
        width: 150px;
        height: 150px;
        background-color: var(--primary-light);
        border-radius: 50%;
        z-index: 0;
        opacity: 0.5;
    }

    .form-container::after {
        content: "";
        position: absolute;
        bottom: -50px;
        left: -50px;
        width: 150px;
        height: 150px;
        background-color: var(--primary-light);
        border-radius: 50%;
        z-index: 0;
        opacity: 0.5;
    }

h1 {
    text-align: center;
    font-size: 30px;
    margin-bottom: 30px;
    color: var(--primary-color);
    position: relative;
    font-weight: 700;
}

    h1::after {
        content: "";
        display: block;
        width: 60px;
        height: 4px;
        background-color: var(--primary-color);
        margin: 10px auto 0;
        border-radius: 2px;
    }

.form-group {
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 15px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
.form-control,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    color: var(--text-color);
}

    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus,
    input[type="tel"]:focus,
    .form-control:focus,
    select:focus {
        border-color: var(--primary-color);
        outline: none;
        box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
    }

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    display: block;
    font-weight: 500;
    transition: all 0.3s ease;
}

.error-panel {
    background-color: rgba(229, 62, 62, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    border-right: 4px solid var(--error-color);
}

.error-text {
    color: var(--error-color);
    font-weight: 500;
}

.terms {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-light);
    padding: 12px 15px;
    border-radius: 8px;
}

    .terms label {
        margin-bottom: 0;
        font-weight: normal;
        font-size: 14px;
    }

    .terms a {
        color: var(--primary-color);
        font-weight: 600;
        text-decoration: none;
    }

        .terms a:hover {
            text-decoration: underline;
        }

    .terms input[type="checkbox"] {
        width: 20px;
        height: 20px;
        cursor: pointer;
        accent-color: var(--primary-color);
    }

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.2);
    margin-top: 10px;
}

    .submit-btn:hover {
        background-color: var(--primary-hover);
        transform: translateY(-2px);
        box-shadow: 0 7px 14px rgba(49, 130, 206, 0.3);
    }

.login-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

    .login-link p {
        color: var(--text-light);
        font-size: 15px;
    }

    .login-link a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 600;
        margin-right: 5px;
        transition: all 0.3s ease;
    }

        .login-link a:hover {
            color: var(--primary-hover);
        }

/* Phone Input Container */
.phone-input-container {
    display: flex;
    position: relative;
}

    .phone-input-container select {
        width: 40%;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        border-right: none;
        background-color: var(--primary-light);
        font-weight: 500;
    }

    .phone-input-container input,
    .phone-input-container .form-control {
        width: 60%;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

/* تحديث أنماط النافذة المنبثقة فقط */

/* Improved Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modal.active-modal {
    display: block;
}

/* Success Modal Specific Styles */
.success-modal {
    max-width: 450px;
    border-top: 5px solid #38a169;
}

.success-icon {
    margin: 0 auto 25px;
    width: 90px;
    height: 90px;
    background-color: rgba(56, 161, 105, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-modal h2 {
    color: #38a169;
    margin-bottom: 15px;
    font-size: 24px;
}

.success-modal p {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #4a5568;
}

.redirect-timer {
    margin-top: 20px;
    font-size: 15px;
    color: #718096;
    padding: 10px;
    background-color: #f7fafc;
    border-radius: 8px;
    display: inline-block;
}

#redirectCounter {
    font-weight: bold;
    color: #3182ce;
    font-size: 18px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

    .close-modal:hover {
        color: #2d3748;
        background-color: #f7fafc;
    }

/* Force modal to show when both classes are applied */
.modal.active-modal {
    display: block !important;
}

/* Override any conflicting styles */
body.modal-active {
    overflow: hidden;
}

/* Make sure validation errors don't hide modals */
.error-message {
    position: relative;
    z-index: 1;
}

/* Ensure sufficient contrast between modal and page */
#successModal.active-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Responsive design */
@media screen and (max-width: 600px) {
    .form-container {
        padding: 25px;
        margin: 15px;
    }

    h1 {
        font-size: 22px;
    }

    .modal-content {
        width: 90%;
        padding: 30px 20px;
    }
}
