@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #312e81;
    --primary-hover: #1e1b4b;
    --secondary: #065f46;
    --secondary-hover: #064e3b;
    --info: #0c4a6e;
    --info-hover: #0369a1;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --warning: #d97706;
    --warning-hover: #b45309;
    --success: #065f46;
    --success-hover: #064e3b;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --text-light: #94a3b8;
    --text-white: #f8fafc;
    --border: #475569;
    --glass: rgba(30, 41, 59, 0.8);
}

body {
    font-family: "Cairo", sans-serif;
    background: var(--dark-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(
        135deg,
        var(--dark-bg) 0%,
        var(--primary) 50%,
        var(--secondary) 100%
    );
}

/* Floating Shapes */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.shape {
    position: absolute;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape:nth-child(1) {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 80px;
    height: 80px;
    top: 70%;
    left: 80%;
    animation-delay: -5s;
}

.shape:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 40%;
    left: 5%;
    animation-delay: -10s;
}

.shape:nth-child(4) {
    width: 150px;
    height: 150px;
    top: 20%;
    left: 70%;
    animation-delay: -15s;
}

.shape:nth-child(5) {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 20%;
    animation-delay: -7s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-20px) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translateY(-40px) rotate(180deg) scale(0.9);
    }
    75% {
        transform: translateY(-20px) rotate(270deg) scale(1.05);
    }
}

/* Particle Animation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--info);
    border-radius: 50%;
    opacity: 0.6;
    animation: rise 15s infinite linear;
}

.particle:nth-child(odd) {
    background: var(--secondary);
    animation-duration: 20s;
}

@keyframes rise {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.container {
    text-align: center;
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Admin Avatar */
.admin-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.admin-avatar::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shine 3s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

.welcome-message {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 25px;
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-white);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideUp 1s ease-out;
}

.welcome-message::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

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

.welcome-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--text-white), var(--text-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.welcome-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    line-height: 1.7;
    color: var(--text-light);
}

/* Icons Animation */
.welcome-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.icon {
    font-size: 2rem;
    color: var(--info);
    animation: bounce 2s ease-in-out infinite;
}

.icon:nth-child(2) {
    animation-delay: 0.3s;
    color: var(--secondary);
}

.icon:nth-child(3) {
    animation-delay: 0.6s;
    color: var(--warning);
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.login-button {
    background: linear-gradient(135deg, var(--secondary), var(--success));
    color: var(--text-white);
    border: none;
    padding: 1.3rem 3.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 12px 35px rgba(6, 95, 70, 0.4);
    font-family: "Cairo", sans-serif;
    position: relative;
    overflow: hidden;
    animation: glow 2s ease-in-out infinite alternate;
}

.login-button::before {
    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;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 20px 45px rgba(6, 95, 70, 0.5);
    background: linear-gradient(
        135deg,
        var(--success-hover),
        var(--secondary-hover)
    );
}

.login-button:active {
    transform: translateY(-2px) scale(1.05);
}

@keyframes glow {
    0% {
        box-shadow: 0 12px 35px rgba(6, 95, 70, 0.4);
    }
    100% {
        box-shadow: 0 12px 35px rgba(6, 95, 70, 0.6);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--dark-card);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 3rem;
    width: 90%;
    max-width: 480px;
    position: relative;
    transform: scale(0.8) translateY(30px);
    transition: all 0.4s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    color: var(--text-white);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    transform: rotate(90deg) scale(1.1);
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 2.5rem;
    text-align: center;
    background: linear-gradient(45deg, var(--info), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: 2rem;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 0.7rem;
    font-weight: 600;
    color: var(--text-white);
    font-size: 1.1rem;
}

.input-wrapper {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 15px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: rgba(30, 41, 59, 0.5);
    font-family: "Cairo", sans-serif;
    direction: rtl;
    color: var(--text-white);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--info);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    transform: translateY(-2px);
}

.form-group input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 0.7rem;
    display: none;
    animation: shake 0.5s ease-in-out;
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.submit-button {
    width: 100%;
    background: linear-gradient(135deg, var(--info), var(--info-hover));
    color: var(--text-white);
    border: none;
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    font-family: "Cairo", sans-serif;
    position: relative;
    overflow: hidden;
}

.submit-button::before {
    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;
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, var(--info-hover), var(--info));
}

.submit-button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .admin-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .welcome-message {
        padding: 2.5rem 2rem;
    }

    .welcome-title {
        font-size: 2.2rem;
    }

    .welcome-subtitle {
        font-size: 1.1rem;
    }

    .login-button {
        padding: 1.1rem 3rem;
        font-size: 1.2rem;
    }

    .modal {
        padding: 2.5rem 2rem;
        margin: 1rem;
    }

    .welcome-icons {
        gap: 1.5rem;
    }

    .icon {
        font-size: 1.5rem;
    }
}
