الأساسيات * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* الحاوية الرئيسية */
.login-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    min-height: 700px;
    flex-wrap: wrap;
}

/* قسم الشخصيات */
.characters-section {
    flex: 1;
    background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-width: 300px;
    min-height: 500px;
}

.characters-section::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    top: -50%;
    left: -50%;
    animation: float 20s linear infinite;
    z-index: 1;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-30px, -30px) rotate(360deg);
    }
}

.characters-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 25px;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
    justify-items: center;
}

/* تصميم الشخصيات */
.character {
    width: 130px;
    height: 170px;
    position: relative;
    transition: all 0.5s ease;
}

.character:hover {
    transform: translateY(-10px);
}

.character-body {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.character-head {
    width: 65px;
    height: 65px;
    background-color: #FFD166;
    border-radius: 50%;
    position: relative;
    z-index: 10;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.character-face {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.character-eyes {
    display: flex;
    justify-content: space-between;
    width: 70%;
    padding-top: 20px;
    margin-bottom: 10px;
}

.eye {
    width: 12px;
    height: 12px;
    background-color: #333;
    border-radius: 50%;
    position: relative;
    transition: transform 0.3s ease;
}

.eye::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
}

.character-mouth {
    width: 30px;
    height: 10px;
    background-color: #333;
    border-radius: 0 0 15px 15px;
    transition: all 0.3s ease;
}

.character-mouth.happy {
    height: 15px;
    border-radius: 15px;
    background-color: #4CAF50;
}

.character-mouth.sad {
    height: 5px;
    border-radius: 15px 15px 0 0;
    background-color: #FF5252;
    transform: translateY(5px);
}

.character-arms {
    position: absolute;
    top: 65px;
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: space-between;
    z-index: 1;
}

.arm {
    width: 14px;
    height: 50px;
    border-radius: 10px;
    position: relative;
    transition: transform 0.5s ease;
}

.left-arm {
    transform-origin: top center;
}

.right-arm {
    transform-origin: top center;
}

.character-legs {
    position: absolute;
    top: 120px;
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.leg {
    width: 18px;
    height: 60px;
    border-radius: 10px;
    transition: transform 0.5s ease;
}

/* ألوان مختلفة لكل شخصية */
#character1 .character-head {
    background-color: #FFD166;
}

#character1 .arm,
#character1 .leg {
    background-color: #06D6A0;
}

#character2 .character-head {
    background-color: #EF476F;
}

#character2 .arm,
#character2 .leg {
    background-color: #FFD166;
}

#character3 .character-head {
    background-color: #06D6A0;
}

#character3 .arm,
#character3 .leg {
    background-color: #EF476F;
}

#character4 .character-head {
    background-color: #118AB2;
}

#character4 .arm,
#character4 .leg {
    background-color: #06D6A0;
}

.characters-title {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
    padding: 0 10px;
}

.characters-title h2 {
    font-size: 26px;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.characters-title p {
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.5;
}

/* قسم تسجيل الدخول */
.login-card {
    flex: 1;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 350px;
    min-height: 500px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-title {
    font-size: 30px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-subtitle {
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.form-input:focus {
    outline: none;
    border-color: #6a11cb;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    background-color: white;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    background-color: #f0f0f0;
    transform: translateY(-50%) scale(1.1);
}

.remember-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.remember-label {
    display: flex;
    align-items: center;
    color: #555;
    font-size: 14px;
    cursor: pointer;
}

.remember-label input {
    margin-right: 8px;
    cursor: pointer;
}

.forgot-link {
    color: #6a11cb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    text-decoration: underline;
    color: #2575fc;
}

.btn {
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(106, 17, 203, 0.2);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::after {
    left: 100%;
}

.w-full {
    width: 100%;
}

.alert-error {
    background-color: #fee;
    border-left: 4px solid #f00;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 5px;
    animation: fadeIn 0.5s ease;
}

.alert-error ul {
    list-style-type: none;
    color: #c00;
    font-size: 14px;
    line-height: 1.5;
}

.character-message {
    margin-top: 30px;
    padding: 15px;
    background-color: #f5f7fa;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    color: #555;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    border-left: 4px solid #6a11cb;
    animation: fadeInUp 0.5s ease-out;
}

.character-message.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* حركات الشخصيات */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

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

    100% {
        transform: rotate(360deg);
    }
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-20deg);
    }

    75% {
        transform: rotate(20deg);
    }
}

@keyframes jump {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-30px) scale(1.1, 0.9);
    }

    50% {
        transform: translateY(0) scale(1);
    }

    70% {
        transform: translateY(-15px) scale(1.05, 0.95);
    }
}

@keyframes happy-dance {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

@keyframes sad-sway {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-10px);
    }
}

/* حالات النظر */
.eye.looking-right {
    transform: translateX(6px);
}

.eye.looking-left {
    transform: translateX(-8px);
}

/* استجابة للشاشات المتوسطة (تابلت) */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
        max-width: 600px;
        min-height: auto;
    }

    .characters-section {
        min-height: 300px;
        padding: 30px 20px;
    }

    .characters-container {
        grid-template-columns: repeat(4, 1fr);
        grid-gap: 20px;
        margin-bottom: 30px;
    }

    .character {
        width: 100px;
        height: 140px;
    }

    .character-head {
        width: 50px;
        height: 50px;
    }

    .character-eyes {
        padding-top: 15px;
    }

    .eye {
        width: 10px;
        height: 10px;
    }

    .character-mouth {
        width: 25px;
    }

    .character-mouth.happy {
        height: 12px;
    }

    .character-mouth.sad {
        height: 4px;
    }

    .character-arms {
        top: 50px;
    }

    .arm {
        width: 12px;
        height: 40px;
    }

    .character-legs {
        top: 100px;
        gap: 20px;
    }

    .leg {
        width: 15px;
        height: 50px;
    }

    .characters-title h2 {
        font-size: 22px;
    }

    .characters-title p {
        font-size: 14px;
    }

    .login-card {
        padding: 40px 30px;
    }

    .login-title {
        font-size: 26px;
    }

    .eye.looking-right {
        transform: translateX(4px);
    }

    .eye.looking-left {
        transform: translateX(-6px);
    }
}

/* استجابة للشاشات الصغيرة (موبايل) */
@media (max-width: 576px) {
    body {
        padding: 10px;
    }

    .login-container {
        border-radius: 15px;
        min-height: auto;
    }

    .characters-section {
        min-height: 250px;
        padding: 25px 15px;
    }

    .characters-container {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 15px;
        margin-bottom: 25px;
    }

    .character {
        width: 90px;
        height: 130px;
    }

    .character-head {
        width: 45px;
        height: 45px;
    }

    .character-eyes {
        padding-top: 12px;
        margin-bottom: 8px;
    }

    .eye {
        width: 9px;
        height: 9px;
    }

    .eye::after {
        width: 4px;
        height: 4px;
    }

    .character-mouth {
        width: 22px;
    }

    .character-arms {
        top: 45px;
    }

    .arm {
        width: 10px;
        height: 35px;
    }

    .character-legs {
        top: 95px;
        gap: 15px;
    }

    .leg {
        width: 13px;
        height: 45px;
    }

    .characters-title h2 {
        font-size: 20px;
    }

    .characters-title p {
        font-size: 13px;
    }

    .login-card {
        padding: 30px 20px;
        min-width: auto;
    }

    .login-title {
        font-size: 24px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .form-input {
        padding: 13px 15px;
        font-size: 14px;
    }

    .password-toggle {
        right: 10px;
        font-size: 16px;
        width: 32px;
        height: 32px;
    }

    .remember-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn {
        padding: 14px;
        font-size: 15px;
    }

    .character-message {
        margin-top: 20px;
        padding: 12px;
        font-size: 13px;
    }
}

/* استجابة للشاشات الصغيرة جداً */
@media (max-width: 380px) {
    .characters-container {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 10px;
    }

    .character {
        width: 80px;
        height: 120px;
    }

    .character-head {
        width: 40px;
        height: 40px;
    }

    .character-legs {
        top: 90px;
    }

    .login-card {
        padding: 25px 15px;
    }
}

/* دعم الشاشات الكبيرة جداً */
@media (min-width: 1400px) {
    .login-container {
        max-width: 1400px;
    }

    .characters-container {
        grid-gap: 40px;
    }

    .character {
        width: 150px;
        height: 190px;
    }

    .character-head {
        width: 75px;
        height: 75px;
    }

    .character-arms {
        top: 75px;
    }

    .character-legs {
        top: 135px;
    }
}

/* تحسينات الوصول */
.form-input:focus-visible {
    outline: 2px solid #6a11cb;
    outline-offset: 2px;
}

.password-toggle:focus-visible {
    outline: 2px solid #6a11cb;
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid #6a11cb;
    outline-offset: 2px;
}

/* تحسينات للوضع الداكن */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }

    .login-container {
        background: #1a1a1a;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    }

    .login-title {
        color: #fff;
    }

    .login-subtitle {
        color: #aaa;
    }

    .form-label {
        color: #ccc;
    }

    .form-input {
        background-color: #2d2d2d;
        border-color: #444;
        color: #fff;
    }

    .form-input:focus {
        background-color: #333;
        border-color: #6a11cb;
    }

    .remember-label {
        color: #ccc;
    }

    .character-message {
        background-color: #2d2d2d;
        color: #ccc;
    }

    .password-toggle {
        color: #aaa;
    }

    .password-toggle:hover {
        background-color: #333;
    }
}