* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #d7e9f3 0%, #a8d4f0 50%, #7ecbf5 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 15s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 15px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px 22px;
    box-shadow: 
        0 15px 50px rgba(19, 160, 230, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #13a0e6, #2ee07a, #f39c12, #e74c3c, #9b59b6);
    border-radius: 24px 24px 0 0;
}

.logo-section {
    margin-bottom: 30px;
}

.logo-wrapper {
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrapper::before {
    content: '';
    position: absolute;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    border: 2px solid rgba(19, 160, 230, 0.2);
    animation: pulse-ring 2s infinite;
}

.logo-wrapper::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1.5px solid rgba(19, 160, 230, 0.1);
    animation: pulse-ring 2s infinite 0.5s;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

.logo-img {
    width: 75px;
    height: 75px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.system-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #173042;
    margin-bottom: 3px;
}

.system-subtitle {
    font-size: 0.75rem;
    color: #13a0e6;
    font-weight: 600;
}

.form-group {
    margin-bottom: 12px;
    text-align: right;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #173042;
    margin-bottom: 4px;
    padding-right: 3px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #13a0e6;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.form-input {
    width: 100%;
    padding: 10px 38px 10px 12px;
    border: 2px solid #e0e8f0;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    color: #173042;
    background: #fafbfc;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #13a0e6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(19, 160, 230, 0.1);
}

.form-input:focus + i,
.input-wrapper:focus-within i {
    color: #13a0e6;
}

select.form-input {
    appearance: none;
    cursor: pointer;
}

.password-toggle {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 5px;
}

.password-toggle:hover {
    color: #13a0e6;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.75rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #555;
}

.remember-me input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #13a0e6;
    cursor: pointer;
}

.forgot-link {
    color: #13a0e6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: #0d7ab8;
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #13a0e6 0%, #0d7ab8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(19, 160, 230, 0.3);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(19, 160, 230, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn .btn-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.login-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.login-btn.loading .btn-text {
    display: none;
}

.login-btn.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.register-btn {
    background: linear-gradient(135deg, #2ee07a 0%, #27ae60 100%);
    box-shadow: 0 3px 12px rgba(46, 224, 122, 0.3);
}

.register-btn:hover {
    box-shadow: 0 8px 25px rgba(46, 224, 122, 0.4);
}

.error-message {
    background: #fee;
    color: #c0392b;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    text-align: right;
    border-right: 4px solid #e74c3c;
}

.error-message.show {
    display: flex;
}

.success-message {
    background: #efe;
    color: #27ae60;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    text-align: right;
    border-right: 4px solid #27ae60;
}

.success-message.show {
    display: flex;
}

.footer-text {
    margin-top: 15px;
    font-size: 0.7rem;
    color: #888;
}

.footer-text strong {
    color: #13a0e6;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #888;
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e8f0;
}

.divider span {
    padding: 0 15px;
}

/* Register section */
.register-section {
    animation: fadeIn 0.3s ease;
}

.register-title {
    font-size: 1rem;
    color: #173042;
    margin-bottom: 15px;
}

.toggle-form {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #555;
}

.toggle-form a {
    color: #13a0e6;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

.toggle-form a:hover {
    color: #0d7ab8;
    text-decoration: underline;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animated background circles */
.bg-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(19, 160, 230, 0.05);
    animation: float-circle 20s infinite ease-in-out;
}

.bg-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation-delay: 5s;
}

.bg-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 10%;
    animation-delay: 10s;
}

@keyframes float-circle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Responsive for small screens */
@media (max-width: 480px) {
    .login-container {
        padding: 10px;
        max-width: 100%;
    }
    .login-card {
        padding: 20px 15px;
        border-radius: 16px;
    }
    .logo-wrapper {
        width: 70px;
        height: 70px;
    }
    .logo-wrapper::before {
        width: 82px;
        height: 82px;
    }
    .logo-wrapper::after {
        width: 94px;
        height: 94px;
    }
    .logo-img {
        width: 60px;
        height: 60px;
    }
    .system-title {
        font-size: 1rem;
    }
    .system-subtitle {
        font-size: 0.7rem;
    }
    .form-input {
        padding: 8px 32px 8px 10px;
        font-size: 0.8rem;
    }
    .login-btn {
        padding: 8px;
        font-size: 0.85rem;
    }
    .remember-forgot {
        font-size: 0.7rem;
    }
    .footer-text {
        font-size: 0.65rem;
    }
}

@media (max-width: 320px) {
    .login-container {
        padding: 5px;
    }
    .login-card {
        padding: 15px 10px;
        border-radius: 12px;
    }
    .system-title {
        font-size: 0.9rem;
    }
    .form-input {
        font-size: 0.75rem;
    }
}