@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900;1000&display=swap');
body {
    font-family: 'Cairo', sans-serif;
    background-image: url('../img/wr.png');
    background-size: cover; /* لجعل الصورة تغطي كامل المساحة */
    background-position: center; /* لجعل الصورة تتموضع في المركز */
    background-repeat: no-repeat; /* منع تكرار الصورة */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

header{
    background-color: rgba(1, 127, 155, .0);
    width: 50px;
    position: fixed;
    display: flex;
    align-items: center;
    padding: 5px 10%; 
    margin-bottom: 39%;
    margin-right: 88%;
} 
header img{
    width: 200px;
}

header img:hover{
    transform: scale(1.1);
    transition: 0.7s;
}

.container {
    background-color: #fff;
    padding: 22px; /* تقليل padding بحيث يكون التباعد الداخلي أقل */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 32px;
    width: 100%;
    max-width: 400px; /* تحديد الحد الأقصى للحجم */
    text-align: center;
    box-sizing: border-box; 
    height: auto; /* تأكد من أن الارتفاع يتغير بناءً على المحتوى */
    margin: 0.2; /* إزالة المسافة بين العنصر والعناصر الأخرى */
}

.containers {
    background-color: rgba(1, 127, 155, .9); /* الخلفية تكون بيضاء مع شفافية بنسبة 80% */
    padding: 122px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 32px; /* تم زيادة التقريب لجعل الزوايا أكثر نعومة */
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-sizing: border-box;
    height: auto;
    margin: 0.2;
}



/* لضبط حجم الصورة بشكل صحيح داخل .containers */
.containers img {
    width: 90%;
    height: auto;
    margin-bottom: 20px;
}
.container img {
    width: 60%;
    height: auto; 
    margin-bottom: 20px;
}

/* تعديل حجم الخط داخل .containers */
h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 24px; /* تعديل حجم الخط */
    font-weight: bold;
}

h1, h3 {
    color: #333;
}

h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

input[type="text"], input[type="password"], input[type="email"] {
    width: 100%;
    padding: 10px;
    margin: 9px 0;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
    border-color: #006faf;
    outline: none;
}

input[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: #006faf;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

input[type="submit"]:hover {
    background-color: #988239;
}

input[type="submit"]:active {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

p {
    margin-top: 20px;
    font-size: 14px;
}

a {
    color: #006faf;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Media Query for Mobile Devices */
@media (max-width: 1023px) {
    body {
        padding: 0;
        background-image: url('../img/wr.png');
    }
    .container, .containers {
        padding: 15px;
    }

    input[type="text"], input[type="password"], input[type="email"] {
        padding: 10px;
    }

    input[type="submit"] {
        padding: 10px;
    }
}

/* تحسين الاستجابة للأجهزة الصغيرة (أقل من 600px) */
@media (max-width: 600px) {
    h2 {
        font-size: 20px; /* تقليل حجم الخط على الأجهزة الصغيرة */
    }

    .container, .containers {
        max-width: 100%; /* التأكد من أن العرض لا يتجاوز 100% */
        padding: 10px; /* تقليل المسافة الداخلية */
    }

    /* تحسين مظهر العناصر ليتم ترتيبها بشكل عمودي */
    body {
        display: flex;
        flex-direction: column; /* ترتيب العناصر عموديًا */
        justify-content: flex-start; /* التأكد من أن العناصر تتراصف من الأعلى */
        margin-top: 60px; /* توفير مساحة بعد header الثابت */
    }

    header {
        background-color: rgba(1, 127, 155, .0);
        width: 100%; /* التأكد من أن header يأخذ كامل العرض */
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        justify-content: center;
        padding: 10px;
        z-index: 10; /* وضع header في المقدمة */
    }

    header img {
        width: 150px; /* تقليل حجم الصورة في header */
    }

    .containers {
        order: 1; /* جعل containers يظهر أولًا */
        margin: 0px 0;
        background-color: rgba(1, 127, 155, .9); /* الخلفية مع الشفافية */
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        border-radius: 32px;
        width: 100%;
        text-align: center;
    }

    .container {
        order: 2; /* جعل container يظهر ثانيًا */
        margin: 0px 0;
        background-color: #fff;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        border-radius: 32px;
        width: 100%;
        text-align: center;
    }

    input[type="text"], input[type="password"], input[type="email"] {
        padding: 10px;
        width: 100%;
        margin: 5px 0;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

    input[type="submit"] {
        padding: 10px;
        background-color: #006faf;
        color: white;
        border: none;
        border-radius: 5px;
        width: 100%;
    }

    input[type="submit"]:hover {
        background-color: #988239;
    }
}

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ffe5e5;
    border-right: 5px solid #ff0000;
    color: #b30000;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    direction: rtl;
    z-index: 9999;
    cursor: default;
    max-width: 320px;
    word-break: break-word;
    transition: right 2.5s ease, opacity 2.5s ease;
}

.error-message i {
    margin-left: 8px;
    font-size: 18px;
    color: #ff0000;
    flex-shrink: 0;
}

.error-message.hide {
    right: -350px;
    opacity: 0;
}

@media (max-width: 400px) {
    .error-message {
        max-width: 90vw;
        font-size: 13px;
        padding: 8px 12px;
    }

    .error-message i {
        font-size: 16px;
    }
}