* {
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: #f0f0f0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 10px; /* إضافة padding للصغير */
}

.outer {
    background: white;
    width: 420px;
    max-width: 100%;
    padding: 70px 40px 50px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    direction: ltr;
}

.title {
    position: absolute;
    left: 50%;
    background: #6e3d7b;
    top: 0px;
    transform: translateX(-50%);
    color: white;
    padding: 12px 40px;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    font-size: 18px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.input-box {
    position: relative;
    margin-bottom: 30px;
}

.input-field {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border-radius: 30px;
    border: 1px solid #ccc;
    outline: none;
    font-size: 16px;
    direction: ltr;
}

.icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: gray;
}

.forgot {
    font-size: 15px;
    margin: -10px 0 25px;
    color: #333;
    cursor: pointer;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: #9265A6;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #6e3d7b;
}

.register {
    margin-top: 30px;
    text-align: center;
    font-size: 15px;
}

.register a {
    color: #6e3d7b;
    text-decoration: none;
    font-weight: bold;
}

.name-box {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.input-box.half {
    flex: 1;
    margin-bottom: 0;
}

.social-media {
    text-align: center;
    margin-top: 25px;
}

.social-media p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.social-icons a {
    font-size: 45px;
    color: #6e3d7b;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: #5d376e;
    transform: scale(1.2);
}

.error-message {
    background-color: #ffe0e0;
    color: #c0392b;
    padding: 12px 20px;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    text-align: center;
    width: fit-content;
    max-width: 90%;
    margin: 20px auto;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* --- الريسبونسيف --- */

@media (max-width: 900px) {
    .outer {
        width: 90%;
        padding: 60px 30px 40px;
    }
}

@media (max-width: 600px) {
    body {
        align-items: center;
        padding: 15px 10px;
        height: 100vh; /* مهم جداً */
        background: #f9f9f9;
    }

    .outer {
        width: 100%;
        max-width: 420px;
        padding: 75px 20px 30px; /* زودت padding-top من 40px لـ 100px */
        border-radius: 15px;
        box-shadow: 0 6px 20px rgba(146, 101, 166, 0.15);
        min-height: auto;
        margin: 20px auto;
    }


    .input-field {
        padding: 14px 45px 14px 15px;
        font-size: 16px;
    }

    .icon {
        font-size: 20px;
        right: 15px;
    }

    .forgot {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .login-btn {
        padding: 16px;
        font-size: 18px;
        border-radius: 25px;
    }

    .register {
        font-size: 15px;
        margin-top: 25px;
    }

    .social-media p {
        font-size: 15px;
    }

    .social-icons a {
        font-size: 40px;
    }

    .error-message {
        font-size: 15px;
        padding: 15px 20px;
        margin: 20px auto;
    }

    /* حاوية الاسم تتحول عمودي مع تقليل الفجوة */
    .name-box {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 25px;
    }

    .input-box.half {
        margin-bottom: 15px;
    }
}


@media (max-width: 350px) {
    .login-btn {
        font-size: 14px;
        padding: 12px;
    }

    .input-field {
        font-size: 14px;
        padding: 12px 40px 12px 12px;
    }

    .icon {
        font-size: 16px;
        right: 12px;
    }
}
